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!

Dates and DateAdd 1

Status
Not open for further replies.

goslincm

MIS
May 23, 2006
292
US
I have a table that has several years worth of [audit_received_date]values in it. I need to compare the most current [audit_received_date] to the current date AND IF the most current [audit_received_date] is more than 2 years from the current date I need to know this.

I'm not good with DateAdd
 
Code:
if (DateAdd("yyyy",2, [audit_received_date]) < date()) then
...your code here
end if

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Thank you very much, any chance you know how to take a field which represents any given month (numeric representation) and create from it, one field that would add whatever the current year is to that two digit month ?

SO if my month is 03 and the current year is 2005 is will store as 03/2005 and the next year is will show as 03/2006
 
Among other ways:
Code:
 Format(DateSerial(Year(Date()),[Enter Month],1),"mm/yyyy")

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Appreciate the help this afternoon, its working good now.
 
Traingamer, will that format change allow me to then compare dates within that field to other fields? or is it merely a cosmetic change the the field?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top