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

getting records from the last 4 weeks 1

Status
Not open for further replies.

klaas01

MIS
Feb 5, 2005
16
NL
Hi,

Since the new year has started i am dealing with this problem:

to filter records from the last 4 weeks i use this formule:
Format(Date();"yyyyww")-1 Or Format(Date();"yyyyww")-2 Or Format(Date();"yyyyww")-3 Or Format(Date();"yyyyww")-4

the problem is in week 2 of the new year this function won't include record from the last 2 weeks of the previous year.

does anybody knows a solution for this problem?

klaas
 
You may try this formula:
Betwween Format(DateAdd("ww";-4;Date());"yyyyww") And Format(DateAdd("ww";-1;Date());"yyyyww")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Oops, I meant this:
Format(DateAdd("ww";-1;Date());"yyyyww") Or Format(DateAdd("ww";-2;Date());"yyyyww") Or Format(DateAdd("ww";-3;Date());"yyyyww") Or Format(DateAdd("ww";-4;Date());"yyyyww")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top