cancel
Showing results for 
Search instead for 
Did you mean: 

Date Range

Former Member
0 Kudos

Hello,

please could someone tell me the formula for the following date range? I want to create and automate a report that picks up data from 1/1/08 to the previous Sunday.

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

This Should be what you are looking for...


{TableName.DateField} in Date(#1/1/2008#) to DateAdd("d", -1 * (DatePart("w", CurrentDate)-2), CurrentDate)

This formula actually goes from midnight on 1/1/2008 to midnight of the previous Monday... That way the Sunday values will be included.

If you want the cutoff to be midnight Sunday... So that only Saturdays values are included, use this formula...


{TableName.DateField} in Date(#1/1/2008#) to DateAdd("d", -1 * (DatePart("w", CurrentDate)-1), CurrentDate)

HTH,

Jason

Former Member
0 Kudos

Excellent! Thanks for your help.

Former Member
0 Kudos

Hi Alexouk,

If you are using the Stored rocedure for your report , then for your requirement you may restrict the report by editing the Where Clause in the stored procedure .

Thanks

--

Ashish