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

Need Formula for Last full week and Previous full week

Status
Not open for further replies.

SchuhTL

Technical User
Dec 19, 2001
36
US
I need to create a report that will show the last full week and the previous full week. Example: If a user runs the report on a Wed. the report will not inclue data from the current week but will show the last full week and the week before that. The report will have two charts comparing weekly stats. I am currently using CR 8.0 Developer. Please let me know if I need to provide more info.
 
Last full week is easy, the function is LastFullWeek. So to get these records in your report

//includes last full week's records
{datefield} in LastFullWeek or

//includes previous week's records
{datefield) in Dateadd("d",-7,minimum(LastFullWeek)) to Dateadd("d",-7,Maximum(LastFullWeek))

Read the help screens on the LastFullWeek and DateAdd() functions if this is not clear.
Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
Since you want to show the previous week and the week before,you should use the dayofWeek function.
For example dayOfWeek(1/5/2002) is 3 in SCR.(Wednesday).So I get your problem right you need the records between 15/04/02 and 28/04/02.
Then in your selection criteria type
<your-date field> in <your date parameter>-
( dayofweek(<your date parameter>)+13) to
to <your date parameter>-
( dayofweek(<your date parameter>))
 
Hattusas has a better solution since the LastFullWeek function by defination is a Sunday to Saturday week and Hattusas answer gives you total flexibility over this. Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top