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!

Access 2000 Between Dates Query 1

Status
Not open for further replies.

Tuck007

Technical User
Apr 29, 2002
105
US
I don't normally use Access, and I am sure something like this has been coverd once before, so thanks ahead if anyone knows a thread I can go look in before wasting peoples time.

I am creating a query for a time keeping report. I'd like to prompt the user for a Time Period End Date that will be used to query the database for employees that have worked between that date, and the two weeks prior. Here is what I have now:
Code:
Between [Enter Pay Period Start Date] And [Enter Pay Period End Date]
This, of course, prompts the user twice, but produces the right results. I wanted to do something smarter, like:
Code:
Between [Enter Pay Period Ending Date] And DateAdd("d",-13,[Enter Pay Period Ending Date])
I don't know Access enough to know how to prompt the user for the date, then calculate the start date from that, and then use the original date as the cut-off for the between statement. Suggestions?

.:TUCK:.
 
Have you tried this ?
Between DateAdd("d",-13,[Enter Pay Period Ending Date]) And [Enter Pay Period Ending Date]

Be sure to define your parameter as DateTime.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV, Thanks! I thought that would just ask me twice, but I entered it and ran the query and it ran as it should. Pops up and asks for one End Date. Thanks again!

.:TUCK:.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top