Unique Records Criteria

  • Thread starter Thread starter doug
  • Start date Start date
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,
 
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.
 
Back
Top