Re: Dont know where to start
- From: stephenrussett@xxxxxxxxx
- Date: Fri, 15 Jun 2007 08:04:49 -0700
On Jun 15, 7:46 am, stephenruss...@xxxxxxxxx wrote:
On Jun 14, 11:27 pm, "Neil" <nos...@xxxxxxxxxx> wrote:
OK, putting his data, below, in a table, and calling the fields Field1,
Field2, etc., and running your SQL:
SELECT Min([Field1]) & " - " & Max([Filed1]) AS Range, Table1.Field2,
Table1.Field3
FROM Table1
GROUP BY Table1.Field2, Table1.Field3;
produces the following results:
Range Field2 Field3
1 - 6 1 Cooper Street
2 - 7 2 Cooper Street
10 - 3 3 Cooper Street
10A - 4 4 Cooper Street
5 - 5 5 Cooper Street
The results he was looking for were:
1 - 5 Cooper Street NS Johnson & Dale
6 - 10A Cooper Street SS Bail & Bob
Even considering that you said he could add additional fields (for columns 4
and 5) the two results sets are clearly not the same. At the very least, one
has five records, the other has two. But the data is also not correct. You
still say your query produces correct results?
Neil
"DavidB" <j...@xxxxxxxxx> wrote in message
news:1181844318.835750.219380@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 14, 1:24 pm, "Neil" <nos...@xxxxxxxxxx> wrote:
Your query doesn't produce the results he was looking for.
"DavidB" <j...@xxxxxxxxx> wrote in message
news:1181841214.506410.179090@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 14, 10:06 am, stephenruss...@xxxxxxxxx wrote:
Ok i what i am trying to do is:
I have a query that pumps out information like this:
(1) (2) (3) (4) (5)
1 1 Cooper Street NS Johnson & Dale
2 2 Cooper Street NS Johnson & Dale
3 3 Cooper Street NS Johnson & Dale
4 4 Cooper Street NS Johnson & Dale
5 5 Cooper Street NS Johnson & Dale
6 1 Cooper Street SS Bail & Bob
7 2 Cooper Street SS Bail & Bob
10 3 Cooper Street SS Bail & Bob
10A 4 Cooper Street SS Bail & Bob
Ok so i have information that looks something like this. What i am
trying to do is have excel open the database and show the information
like this:
1 - 5 Cooper Street NS Johnson & Dale
6 - 10A Cooper Street SS Bail & Bob
Is it possible to have excel do this?
SELECT Min([Field1]) & " - " & Max([Filed1]) AS Range, Table1.Field2,
Table1.Field3
FROM Table1
GROUP BY Table1.Field2, Table1.Field3;
Add fields as necessary- Hide quoted text -
- Show quoted text -
Sure it does- Hide quoted text -
- Show quoted text -
Neil can you explain your SQL to me. Like explain what your code
does. I am having troubles putting it to use and i wanted to make
sure i was not missing anything.
Thanks- Hide quoted text -
- Show quoted text -
ok so i used this data as a sample
Field1 Field2 Field3 Field4 Field5
1 1 Cooper NS Jell & Bell
2 2 Cooper NS Jell & Bell
3A 3 Cooper NS Jell & Bell
4 4 Cooper NS Jell & Bell
5 1 Cooper SS Bob & Free
6 2 Cooper SS Bob & Free
7 3 Cooper SS Bob & Free
10 4 Cooper SS Bob & Free
12 5 Cooper SS Bob & Free
13A 1 Frank SS Bob & Free
13B 2 Frank SS Bob & Free
14C 3 Frank SS Bob & Free
And this is what i got from query 2
Expr1 Field3 Field4 Field5
1 - 4 Cooper NS Jell & Bell
13A - 12 Frank SS Bob & Free
13A - 12 Cooper SS Bob & Free
5 - 12 Frank SS Bob & Free
5 - 12 Cooper SS Bob & Free
Help?
.
- Follow-Ups:
- Re: Dont know where to start
- From: Neil
- Re: Dont know where to start
- From: stephenrussett
- Re: Dont know where to start
- References:
- Dont know where to start
- From: stephenrussett
- Re: Dont know where to start
- From: DavidB
- Re: Dont know where to start
- From: Neil
- Re: Dont know where to start
- From: DavidB
- Re: Dont know where to start
- From: Neil
- Re: Dont know where to start
- From: stephenrussett
- Dont know where to start
- Prev by Date: Re: Help with DCount/DLookup
- Next by Date: Summing a Calculated Avg
- Previous by thread: Re: Dont know where to start
- Next by thread: Re: Dont know where to start
- Index(es):
Relevant Pages
|