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

Date criteria from Monday to Date()

Status
Not open for further replies.

SDS100UK

MIS
Jul 15, 2001
185
0
0
GB
Hi,

I have a query where I want to set the criteria to say:-
From Monday of the current week upto Date()-1.

So when I run it on a Thursday it will give me the date from the Monday to Wednesday.

Many thanks in advance

Steven
 
How about Between Date()+1-weekday(Date()) And Date()-1? Or tell the weekday function that Monday is the first day of the week (don't use the function, but have heard it can be done) and skip the "+1".
 
Between Date()-weekday(Date(),vbMonday) And Date()-1 should do it; got help from the immediate window.
 
DateAdd("d", vbMonday - Weekday(Date), Date) will always return the 'previous' Monday's date.

Date - 1 will always return yesterdays date.

there will be some problems if you combine these a-la tempclerk's approach and do this on a monday

e.g. between 10/22/2001 and 10/21/2001 which would be the result from Monday Oct. 22, 2001, may produce bad Carma or other job related stress.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Good point, Michael. I took the question literally and figured it wasn't going to be used on Monday.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top