Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you add time to a Delete query? 1

Status
Not open for further replies.

quest4

Technical User
Aug 27, 2001
735
US
Good afternoon, folks. I have a WHERE statement which I need to modify to say anything three years old today. Here is my statement:
WHERE (((tblECN_MasterData.DateEnd)<=Date())) OR (((tblECN_MasterData.DateCancelled)<=Date()));
Thank you to anyone answering this question.
 
Subtract three years worth of days (less one) from the current date.

Code:
WHERE (((tblECN_MasterData.DateEnd)<=Date()-1094)) OR (((tblECN_MasterData.DateCancelled)<=Date()-1094));

Unfortunately this will not take into account any leapyears the may or may not have occured during the past 3 years.

Shane
 
Thank you for the assistance, Shane. Works great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top