Unique Records Criteria

D

doug

I am a recent access user. I am trying to select only
unique records for a given field in my query (that joins
2 tables). I have worked with the unique records/values
setting in Properties, yet I still get duplicates. What
is the criteria function for selecting only unique
records for a field?

Thank you very much,
 
J

John Mishefske

doug said:
I am a recent access user. I am trying to select only
unique records for a given field in my query (that joins
2 tables). I have worked with the unique records/values
setting in Properties, yet I still get duplicates. What
is the criteria function for selecting only unique
records for a field?

Thank you very much,

You can get distinct values for a single field using the
DISTINCT keyword (Unique values).

SELECT DISTINCT
AccountCode
FROM
Accounts ;

if you add fields then you may not get one row for each account code
because there may be distinct values for transaction type:

SELECT DISTINCT
AccountNumber
, TransactionType
FROM
Account;

DISTINCTROW (Unique records) has more functionality primarily where
there are joined tables.
 

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