Ah - perhaps we're just at cross purposes. In the attributes table there are 2 records for ID=2259
Constituent ID |
Constituent Specific Attributes Contact Preferences Import ID |
Constituent Specific Attributes Contact Preferences Description |
Constituent Specific Attributes Contact Preferences Date |
Constituent Specific Attributes Contact Preferences Comments |
2259 |
00001-528-0000449513 |
Email opt out |
02/11/2016 |
Bounced |
2259 |
00001-528-0000046474 |
Email opt in |
|
|
As one of these has no date it appears in my query results.
Similarly for other IDs with a null date record
So my query correctly does what I thought you described in post 1
BUT you want only those IDs where there are no duplicates AND then from that list filter again to only show those where the date field is NULL.
Not the same thing!
Yes, that does have 1175 records & can easily be done with one query
Code:
SELECT Attribute.[Constituent ID], Attribute_1.[Constituent Specific Attributes Contact Preferences Import ID], Attribute_1.[Constituent Specific Attributes Contact Preferences Description]FROM Attribute AS Attribute_1 INNER JOIN Attribute ON Attribute_1.[Constituent ID] = Attribute.[Constituent ID]
WHERE (((Attribute_1.[Constituent Specific Attributes Contact Preferences Date]) Is Null))
GROUP BY Attribute.[Constituent ID], Attribute_1.[Constituent Specific Attributes Contact Preferences Import ID], Attribute_1.[Constituent Specific Attributes Contact Preferences Description]
HAVING (((Count(Attribute.[Constituent ID]))=1));
NOTE: I still haven't looked at the alternative 3 step solution