Update query

  • Thread starter Thread starter Simon Glencross
  • Start date Start date
S

Simon Glencross

I have the following update query

UPDATE tblcustomers INNER JOIN tblservice ON tblcustomers.ID =
tblservice.CustomerID SET tblservice.ServiceReminderSent = False
WHERE (((tblservice.ActDateCompleted) Is Null));

What I want to also be able to do is select only records with the current
date in the sentdate field.

Any suggestions please?
 
UPDATE tblcustomers INNER JOIN tblservice
ON tblcustomers.ID = tblservice.CustomerID
SET tblservice.ServiceReminderSent = False
WHERE (((tblservice.ActDateCompleted) Is Null)) AND SentDate = Date()

If I didn't qualify the table for SentDate since you didn't say which table it
is in.

If SentDate also contains the time, then modify this to
... And SentDate Between Date() and Date()+1

You could, in theory end up with a record that was sent at exactly midnight of
the following day, but in most cases that is an unlikely event.
 
Back
Top