Previous Week, Month, year, etc.

J

JMDennis7

My Db records my daily work activities according to the various projects to
which I am assigned. For the purpose of reporting back to my supervisor, I'm
building a series of queries that will display only those records that cover
specific periods of time. The use of a parameter query will take care of
custom periods and I am using the following criteria for the Current periods
of Week, Month & Year:
=Date()-Weekday(Date())+1
=Date()-Month(Date())+1
=Date()-Year(Date())+1

What I need are criteria for the previous week, month and year.

I appreciate your help.
 
M

Marshall Barton

JMDennis7 said:
My Db records my daily work activities according to the various projects to
which I am assigned. For the purpose of reporting back to my supervisor, I'm
building a series of queries that will display only those records that cover
specific periods of time. The use of a parameter query will take care of
custom periods and I am using the following criteria for the Current periods
of Week, Month & Year:


What I need are criteria for the previous week, month and year.


You should use the DateAdd (or maybe DateSerial) function
for that.
 
J

John Spencer

Previous Month:
Between DateSerial(Year(Date()),Month(Date())-1,1) and
DateSerial(Year(Date()),Month(Date()),0)

Previous Year:
Between DateSerial(Year(Date())-1,1,1) and DateSerial(Year(Date())-1,12.31)

Previous Week is a bit more difficult:.
Assumption Week starts on Sunday:
Between DateAdd("d",1-Weekday(Date()),Date)-7 And
DateAdd("d",7-Weekday(Date()),Date())-7
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Date Records 1
Last Year/Next Year Calculation 3
Query week, month, quarter 5
DateSerial reference to last year 6
cheking existing data for previous month 5
Date criteria 12
YTD 2
Membership Expiry Dates 2

Top