Update table from command

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to change the value of EmailSentTL to 1 where EmailSentTl = 0 and where
the date is 2 or more days older than today. I'm trying the following
command but it obviouslt does not work. Thanks for the help.

DoCmd.RunSQL "UPDATE ECBData1 SET ECBData1.EmailSentTl = 1 WHERE
(((ECBData1.EmailSentTl)=0)) AND ((ECBData1.Date => Date()-2))"
 
Try this:

Dim strsql As String

strsql = "UPDATE ECBData1 SET ECBData1.EmailSentTl = 1 WHERE " & _
"(((ECBData1.EmailSentTl)=0)) AND ((ECBData1.Date <= Date()-2))"
CurrentDb.Execute strsql
 
Back
Top