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!

Automate query criteria 1

Status
Not open for further replies.

gwoman

Programmer
Joined
Nov 16, 2004
Messages
199
Location
US
I have a macro that runs a series of queries that create and append data to a table. In these queries there is a field EFTV_DATE that has a criteria of #12/1/(previous year)#. These produce a year end report and are always run in January ... so for instance this being 2009 the criteria would be #12/1/2008#. Right now I have to go into a mass of different queries and manually change the year in the criteria. Is there anyway to automate this in the query? So next year when I run these it will look at Date() and know that is needs to be #12/1/2009#.

Thanks much ...

gwoman
 
DateSerial(Year(Date())-1,1,12)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Excellent ... it works perfectly!
You totally rock PHV!!!

Have a good one!

gwoman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top