G
Guest
Hi. I have code that I can't get to work so I had the query wizard write it
for me in sql and now I'm trying to convert it to code.
Here's the wizard sql:
UPDATE tblAuctionDonors SET tblAuctionDonors.DateSent = Date()
WHERE (((tblAuctionDonors.AskAgain)=Yes) AND ((tblAuctionDonors.DateSent) Is
Null)) OR (((tblAuctionDonors.AskAgain)=Yes) AND
((tblAuctionDonors.DateSent)<DateSerial(Year(Date()),10,1)));
This sql correctly updates the table.
Here's what I'm trying to convert it to:
strWhere = "(([tblAuctionDonors.AskAgain]=Yes) AND
([tblAuctionDonors.DateSent] Is Null)) OR (([tblAuctionDonors.AskAgain]=Yes)
AND ([tblAuctionDonors.DateSent]<DateSerial(Year(Date()),10,1)))"
strSQL = "Update tblAuctionDonors Set tblAuctionDonors.DateSent=Date() where
" & strWhere
This code does nothing and I'm not sure why. Any suggestions? My sql and
coding "skills" are equally poor. I appreciate your help.
for me in sql and now I'm trying to convert it to code.
Here's the wizard sql:
UPDATE tblAuctionDonors SET tblAuctionDonors.DateSent = Date()
WHERE (((tblAuctionDonors.AskAgain)=Yes) AND ((tblAuctionDonors.DateSent) Is
Null)) OR (((tblAuctionDonors.AskAgain)=Yes) AND
((tblAuctionDonors.DateSent)<DateSerial(Year(Date()),10,1)));
This sql correctly updates the table.
Here's what I'm trying to convert it to:
strWhere = "(([tblAuctionDonors.AskAgain]=Yes) AND
([tblAuctionDonors.DateSent] Is Null)) OR (([tblAuctionDonors.AskAgain]=Yes)
AND ([tblAuctionDonors.DateSent]<DateSerial(Year(Date()),10,1)))"
strSQL = "Update tblAuctionDonors Set tblAuctionDonors.DateSent=Date() where
" & strWhere
This code does nothing and I'm not sure why. Any suggestions? My sql and
coding "skills" are equally poor. I appreciate your help.