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

**Need Help with Date Range**

Status
Not open for further replies.

goduke

IS-IT--Management
Feb 13, 2006
65
US
Hello,

I am trying to add a date range into my select criteria to pull the last 5 full weeks. I know how to pull the last five weeks in general, but I need the last 5 full weeks. So if you were to run it today it would pull in the weeks of:

Jan3-Jan9
Jan10-Jan16
Jan17-Jan23
Jan24-Jan30
Jan31-Feb6

Thanks for your help!

 
I think this should do what you are asking (provide all the days of the previous 5 full weeks):


{Table.DateField} in [(minimum(lastfullweek)-35) to (maximum(lastfullweek))]



 
Thank you fisheromacse for the help. Unfortunately it didnt work when I added what you posted, since the minimum(lastfullweek)-35 was pulling in a few records from the week before. However, i changed that to maximum(lastfullweek)-34 and it worked perfectly. Thanks for your help.
 
Good deal!

glad you got it.

I just typed off the top of my head and didn't test, sorry about that.
 
I think you are getting an extra week in there. Also lastfullweek runs from Sunday to Saturday, so I think the formula should be:

{table.date} in minimum(Lastfullweek)-28 to maximum(lastfullweek)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top