I have an Access97 Database (I realize that Access has it's own SQL "flavor"where I want to track respondents to a direct mail campaign. I track the name & address of who is sent the campaign and code their name entry with a unique campaign code ("MediaCode" field). When they respond - incomming with a different campaign code ("MediaCode" field), they are entered into the database again....so I will have two records of the same person, but with different MediaCodes. I then have a field where I group those of same address together --I'm householding them (the "DupeGroup" field). What I am trying to do is write an SQL statement that says "find the records that have the same DupeGroup number. Within each of those DupeGroups, show me only the DupeGroups that have records containing MediaCode X and MediaCode Y in a MediaCode field.<br>
<br>
This is as far as I've gone, but it doesn't work:<br>
<br>
SELECT Contacts.GroupDupe, Contacts.FirstName, Contacts.LastName, Contacts.MediaCode<br>
FROM Contacts<br>
WHERE (((Contacts.GroupDupe)=[GroupDupe]) AND ((Contacts.MediaCode)="DM1" And (Contacts.MediaCode)="DM1R");<br>
<br>
Thanks for helping a newbie!<br>
<br>
This is as far as I've gone, but it doesn't work:<br>
<br>
SELECT Contacts.GroupDupe, Contacts.FirstName, Contacts.LastName, Contacts.MediaCode<br>
FROM Contacts<br>
WHERE (((Contacts.GroupDupe)=[GroupDupe]) AND ((Contacts.MediaCode)="DM1" And (Contacts.MediaCode)="DM1R");<br>
<br>
Thanks for helping a newbie!<br>