Hi peeps,
I'm a newbie to Access and SQL, so would greatly appreciate some help with this as I am tearing my hair out!!
I have two tables, S1_C and S1_AC which are successfully joined on [Author_name] and [Author Names]. S1_C contains a number of duplicate [Author_name]s.
I'm trying to produce a list of unique entries, based on the following:
1. All records in S1_C where S1_C.[Person Attribute Type] = "ANB Identifier"
2. All records which can be found in both, irrespective of S1_C.[Person Attribute Type]
3. Where multiple matching records are found in S1_C, the record with the ANB Identifier trumps any others, if it exists. If not, then I will evaluate the duplicates manually.
I have the following so far, but it's returning ~480 records because of the duplicates described in 3. I have run a similar comparison in Excel (which I'm far more familiar with!) and got ~455 records, but need this to be an automated query in Access because there is a lot of additional queries I need to write once I have the results of this!
SELECT DISTINCT S1_C.[Person ID], S1_C.[First Name], S1_C.[Last Name], S1_AC.[Author Names], S1_C.[Person Attribute Type]
FROM S1_C
INNER JOIN S1_AC ON S1_C.[Author_name] = S1_AC.[Author Names]
UNION
SELECT DISTINCT S1_C.[Person ID], S1_C.[First Name], S1_C.[Last Name], S1_AC.[Author Names], S1_C.[Person Attribute Type]
FROM S1_C
WHERE S1_C.[Person Attribute Type] = "ANB Identifier";
Please help!!