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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pull data from today back one year 2

Status
Not open for further replies.

ado2002

Programmer
Feb 6, 2002
4
0
0
US
Hi,

I would like to know if there is criteria that I can use to gather data for today and exactly one year prior. I have tried the <=now(), but it gives me everything prior to today. I need to narrow it down to only one year's worth of data.

Thank you in advance.
Anjie
 
Have a look at the DateDiff function to calculate a date exactly a year ago ....

Hope this helps [pipe]
 
try Between DateAdd("yyyy",-1,Date()) And Date()

Avoid the now() function unless you really want to take the time of day into account. The date() function gives today's date without a time of day.
 
how could this be done if i wanted to deduct 1 month?

Be ALERT - Your country needs Lerts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top