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!

Field criteria for previous week 1

Status
Not open for further replies.

cob5

Technical User
Nov 19, 2001
5
0
0
US
I am new to access and have a query that links 3 tables. It is a pretty simple query but I need to make the date field criteria pull only information from the last week. I can manually change the criteria every week, but I want to have it automatic so that it can be added to a weekly macro that is run. My knowledge is limited to putting in the criteria (no code). Any help is appreciated.

Thx
 
Cob

THis is what i use in my date queries

In the date field under the criteria type this code in:

Between [Enter starting date] and [Enter ending date]

This puts an input box on screen when the query is choosen, and you type in the first date, then another to get the ending date.

hope this is what your looking for
Raven
 
This is a start. Do you have any idea how I can make Access automatically calculate it. I.e. when I run the query, it automatically gives me the results from the last 7 days without any input??
 
I have my answer. A colleague in my office helped me out. The critria in the date field should be:

Between DateAdd("d",-7,Date()) And DateAdd("d",-2,Date())

I am running the macro on Mondays, so this will give me all the pertinant info from the previous work week (Monday-Sat)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top