A two field, flat table, SQL question?

F

Frank B

I'm asking for SQL that I can put into the RowSource for a
combo-box. I am only interested in seeing 2 fields
(columns). Both fields are in 1 table (TBL).

Field IX is the index. (no duplicates)
Field DD contains a name. (has duplicates)

If there are duplicates, I only want to see 1, but I also
need to see the IX for that record. Like this....

COL1 COL2
-----| -----
IXa | Name1
IXb | Name2 (there may be Dups of Name2...
IXc | Name3 ...but I only want to see 1)
etc.| etc.

I appreciate your help.
Thanks,
Frank
 
D

Dan Artuso

Hi,
If your index field is numeric, you can create a totals query with Max(IX)
and grouping on DD.

SELECT Max(IX) AS MaxOfIX, DD
FROM TBL
GROUP BY DD;
 
F

Frank B

Thanks Dan,

It did exactly what I wanted! I appreciate you taking the
time to help me.

With regards,
Frank

-----Original Message-----
Hi,
If your index field is numeric, you can create a totals query with Max(IX)
and grouping on DD.

SELECT Max(IX) AS MaxOfIX, DD
FROM TBL
GROUP BY DD;


--
HTH
Dan Artuso, Access MVP


"Frank B" <[email protected]> wrote in
message news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top