Answers for "add() statement sql"

SQL
0

sql add statement access

PARAMETERS LastDateToKeep DateTime;
INSERT INTO tblContactEventsHistory
  (ContactID, ContactDateTime, ContactEventType, ContactNotes )
 SELECT tblContactEvents.ContactID, tblContactEvents.ContactDateTime,
   tlkpContactEventTypes.ContactEventTypeDescription,
   tblContactEvents.ContactNotes
  FROM tlkpContactEventTypes
  INNER JOIN (tblContactEvents
   LEFT JOIN tblContactEventsHistory
   ON (tblContactEvents.ContactID = tblContactEventsHistory.ContactID)
    AND (tblContactEvents.ContactDateTime =
     tblContactEventsHistory.ContactDateTime))
  ON tlkpContactEventTypes.ContactEventTypeID =
   tblContactEvents.ContactEventTypeID
 WHERE (tblContactEvents.ContactDateTime<[LastDateToKeep])
  AND (tblContactEventsHistory.ContactID Is Null);
Posted by: Guest on June-04-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language