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

LastFullWeek (Monday - Sunday) ? 2

Status
Not open for further replies.

willz99ta

IS-IT--Management
Sep 15, 2004
132
US
Hi and thanks for your help,

I am trying to use a Crystal Reports selection query using LastFullWeek as the date range. My problem is that the week at my organization uses Monday - Sunday as the week.

What is the best way to have the date range look for the last full Monday-Sunday time interval?

Thanks for your help,
Will
 
In your record Selection Editor, add:

table.date in [(Minimum(lastfullweek)+1) to (Maximum(lastfullweek)+1)]

 
The formula won't work correctly on certain days though (and I may have made this mistake in other threads myself). For example, if you run a report on Sunday, March 7, the last full week should be 2/22-2/28, since Sunday is not yet complete, but the above formula would return 3/1 - 3/7.

I think a better formula would be:

{table.date} in currentdate-dayofweek(currentdate,crMonday)-6 to
currentdate-dayofweek(currentdate,crMonday)

-LB
 
I am also using LastFullWeek. My week is from Monday to Friday. The report will run each Monday morning for last o Monday to Friday. No issue in using the function if I ran the report. Now I want to display the date range which is last Monday and last Friday in the report even if I test the report other than Monday.
Any help will be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top