Query without repetitiveness

J

Jesse.CLHsu

Hi All,

I hope this is not too silly a question to ask here. Actually the
question comes from my boss. Anyway, here's the result I get from a
query
..
[Field 1] [Field 2] [Field 3]
A B D
A B E
A B F
A C D
A C E
A C F

Is there any way to make the result of the query look like below?

[Field 1] [Field 2] [Field 3]
A B D
C E
F

I tried to sort and select only the "First" that appears, but it comes
up with

[Field 1] [Field 2] [Field 3]
A B D


Thanks a lot in advance for any suggestions!


CL
 
L

Lance

Not in a query, but it's easy to do in a report... in fact it's completely
wizard driven.

If all your boss cares about it how it displays when he sees it.. go that
route.
 
J

Jesse.CLHsu

Thanks, Lance. That was really helpful. But it still appears to be
like the following

[Field 1] [Field 2] [Field 3]
A B D
E
F
C D
E
F

How to make Field 3 less redundant? Thanks a lot!


CL

Not in a query, but it's easy to do in a report... in fact it's completely
wizard driven.

If all your boss cares about it how it displays when he sees it.. go that
route.



I hope this is not too silly a question to ask here. Actually the
question comes from my boss. Anyway, here's the result I get from a
query
..
[Field 1] [Field 2] [Field 3]
A B D
A B E
A B F
A C D
A C E
A C F
Is there any way to make the result of the query look like below?
[Field 1] [Field 2] [Field 3]
A B D
C E
F
I tried to sort and select only the "First" that appears, but it comes
up with
[Field 1] [Field 2] [Field 3]
A B D
Thanks a lot in advance for any suggestions!

- -
 
J

John Nurick

Hi Jesse,

It sounds as if in effect you need three independent columns, each
sorted in alphabetical order:

1 - distinct values from Field 1 (in this case, only "A")
2 - distinct values from Field 2 (the two values "B" and "C")
3 - distinct values from Field 3 (3 values "D", "E" and "F").

Doing this in a single query is probably possible (as long as the
table has a primary key) but isn't much fun. How about using a report
with three little sub-reports, laid out side by side, with
recordsources
SELECT DISTINCT [Field 1] FROM MyTable ORDER BY 1;
SELECT DISTINCT [Field 2] FROM MyTable ORDER BY 1;
SELECT DISTINCT [Field 3] FROM MyTable ORDER BY 1;
?

Thanks, Lance. That was really helpful. But it still appears to be
like the following

[Field 1] [Field 2] [Field 3]
A B D
E
F
C D
E
F

How to make Field 3 less redundant? Thanks a lot!


CL

Not in a query, but it's easy to do in a report... in fact it's completely
wizard driven.

If all your boss cares about it how it displays when he sees it.. go that
route.



I hope this is not too silly a question to ask here. Actually the
question comes from my boss. Anyway, here's the result I get from a
query
..
[Field 1] [Field 2] [Field 3]
A B D
A B E
A B F
A C D
A C E
A C F
Is there any way to make the result of the query look like below?
[Field 1] [Field 2] [Field 3]
A B D
C E
F
I tried to sort and select only the "First" that appears, but it comes
up with
[Field 1] [Field 2] [Field 3]
A B D
Thanks a lot in advance for any suggestions!

- -
 
Top