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

Query to find records from 1 year ago

Status
Not open for further replies.

Zorro1265

Technical User
Nov 14, 2000
181
US
I need to make a query that will show all results from 1 year from today + or - a week. Any thoughts? Zorro
 
Hi Zorro

If you put >=DateAdd("yyyy",-1,Date()) in the criteria field of your date query, that will limit the records to the last year.

You can do similar things with the other options of DateAdd

Hope this helps a bit

Regards
Tom
 
between dateadd("d",-7,Dateserial(year(date())-1,month(date()),day(date()))) and dateadd("d",7,Dateserial(year(date())-1,month(date()),day(date())))
 
This will give the same
Dateserial(year(date())-1,month(date()),day(date()-7)) and Dateserial(year(date())-1,month(date()),day(date()+7))
 
what about something a little easier to read

where now()-thedate between 358 and 372

for plus or minus a week


rudy
 
Thanks gol4, I tried the first option you gave me and it worked great. I couldnt get the other 2 to work but one is all I needed. Zorro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top