T
TraciAnn via AccessMonster.com
Contact table
ContactID
FirstName
LastName
etc.
Communication table
CommunicationID
ContactID
IntroEmailDate
etc.
ContactSchedule table
ContactScheduleID
ScheduleID
ContactID
I export a query which queries the ContactSchedule for all Contacts that have
a schedule but haven't received an email (Communication.IntroEmailDate = Is
Null).
I then run an update query with the same parameters to update Communication.
IntroEmailDate with the current date (Date()).
It works great for records where the ContactID is in the Communication table,
but if the ContactID doesn't exist, a record is added with just a new
Communication record with an IntroEmailDate but no ContactID to assign it to.
When I run the update, do I include:
SET Communication.ContactID = ContactSchedule.ContactID ?
Here is the current SQL:
UPDATE (Contact RIGHT JOIN ContactSchedule ON Contact.ContactID =
ContactSchedule.ContactID) LEFT JOIN Communication ON Contact.ContactID =
Communication.ContactID SET Communication.IntroEmailDate = Date()
WHERE (((Communication.IntroEmailDate) Is Null) AND ((ContactSchedule.
ContactID) Between 1 And 99999) AND ((Contact.Status)=1) AND (
(ContactSchedule.RoleID)=3) AND ((Contact.ContactEmail) Is Not Null));
Thanks in advance!!!
ContactID
FirstName
LastName
etc.
Communication table
CommunicationID
ContactID
IntroEmailDate
etc.
ContactSchedule table
ContactScheduleID
ScheduleID
ContactID
I export a query which queries the ContactSchedule for all Contacts that have
a schedule but haven't received an email (Communication.IntroEmailDate = Is
Null).
I then run an update query with the same parameters to update Communication.
IntroEmailDate with the current date (Date()).
It works great for records where the ContactID is in the Communication table,
but if the ContactID doesn't exist, a record is added with just a new
Communication record with an IntroEmailDate but no ContactID to assign it to.
When I run the update, do I include:
SET Communication.ContactID = ContactSchedule.ContactID ?
Here is the current SQL:
UPDATE (Contact RIGHT JOIN ContactSchedule ON Contact.ContactID =
ContactSchedule.ContactID) LEFT JOIN Communication ON Contact.ContactID =
Communication.ContactID SET Communication.IntroEmailDate = Date()
WHERE (((Communication.IntroEmailDate) Is Null) AND ((ContactSchedule.
ContactID) Between 1 And 99999) AND ((Contact.Status)=1) AND (
(ContactSchedule.RoleID)=3) AND ((Contact.ContactEmail) Is Not Null));
Thanks in advance!!!