Update table from command

Q

Qaspec

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))"
 
G

Guest

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
 

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

Top