Unique Values only please

J

JR Hester

Just plain brain dead ayt this point! Access XP on Win XP

Query to find the unique value sets in a table. HAve approximately 5200
records in a table. One field is date, another is classname. How do I set the
query to only display UNIQUE date/classname combinations. I am sure I have
done thsi before, but can't remember where I found the Unique values control.

Who can point me in the right direction again?

Thanks
 
P

pietlinden

Just plain brain dead ayt this point! Access XP on Win XP

Query to find the unique value sets in a table. HAve approximately 5200
records in a table. One field is date, another is classname. How do I set the
query to only display UNIQUE date/classname combinations. I am sure I have
done thsi before, but can't remember where I found the Unique values control.

Who can point me in the right direction again?

Thanks

There's an option in the Query Grid, I think, but since I can
understand SQL (except for the junk at work), I just change the
opening
SELECT ...
to
SELECT DISTINCT...

and that does it.
 
K

Ken Snell \(MVP\)

Two ways:

SELECT DISTINCT DateFieldName, ClassNameField
FROM TableName;


or,

SELECT DateFieldName, ClassNameField
FROM TableName
GROUP BY DateFieldName, ClassNameField;
 
K

KARL DEWEY

Use a Totals query. Create a query in design view, pull down the two fields
to the Field row of the design grid.
Click on the Greek letter that looks like a bold 'E' and the grid changes
from --
Field:
Table:
Sort:
Show:
Criteria:
to ---
Field:
Table:
Total: ---------- difference
Sort:
Show:
Criteria:

Save and run your query.
 
M

Marshall Barton

JR said:
Just plain brain dead ayt this point! Access XP on Win XP

Query to find the unique value sets in a table. HAve approximately 5200
records in a table. One field is date, another is classname. How do I set the
query to only display UNIQUE date/classname combinations. I am sure I have
done thsi before, but can't remember where I found the Unique values control.

Who can point me in the right direction again?


I like the other answers, but maybe you want a pointer
instead. Just double click in a blank area of the top
portion of the query design window and look at the
Unique Values property in the property sheet ;-)
 
J

JR Hester

This worked very well, Thanks. I don't usually work in teeh Sql view, but
your instructions were easily followed. Thanks for that tip.
 
J

JR Hester

Thanks, I used the SELECT DISTINCT method.

Ken Snell (MVP) said:
Two ways:

SELECT DISTINCT DateFieldName, ClassNameField
FROM TableName;


or,

SELECT DateFieldName, ClassNameField
FROM TableName
GROUP BY DateFieldName, ClassNameField;
 
J

JR Hester

Thanks Marshall, I used the DISTINCT method, suggested by earlier posts. I
used that because I could not find that "blank" area you described. I kept
cliclking in teh title bar of the query. After rereading your post a few
times I went back found teh area you described, to the right of the
tables/queries data sources for the query. That was EXACTLY the control
properties box I remembered uising last month, just could not remember how I
activated it.

Thanks for your pointer, it was indeed just what I was looking for.

Thanks to you and ALL the posters who make this such a vaulable resource to
those less knowledgeable users.
 

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