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

Grab 1 year's worth of data based on now() function

Status
Not open for further replies.

5ybarite

MIS
Jan 22, 2005
8
US
I appologize if this issue is already addressed here in the forums, but I did not find anything that I could use.

I'm building a query which I would like to grab information from a table that is updated twice a month. I want that grab to be based on today's date everytime it's run. From the date it is run, it will go back and get everything that has been added in the last year. I have a date field in the table along with autonumber uniquie ID. Am I overthinking the plumbing on this, or is it something extrordinarily simple? (A2K2, W2K)

Thanks in advance,
~5ybarite
 
In the criteria field for the record date use this:

Between (Now()) And (Now()-365)

This works with my data. I am presuming that you know the rest of the details for building your query.
 
More accurate to take care of leap years would be:
Between DateAdd("yyyy",-1,Now()) AND Now()

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top