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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top