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!

is crystal clever enough for weekends?

Status
Not open for further replies.

daveinuk

Technical User
Sep 2, 2005
72
DE
Hi All.

Im using CR8.5

Is crystal clever enough to work out weekends?

I have a report that if i run today i get a list of all the faults from yesterday. However on a monday I want to get a list of all the faults from Friday. Do I need to write 2 reports or is there a last weekday command of anything like that?

All help, thanks in advance.

David.
 
Use the dayofweek() function, which returns a 1 (Sunday) thru 7 (Saturday). Then use if-then funtionality to select the proper records:

if dayofweek(currentdate) in 3 to 7 then {YourDateField} = CurrentDate-1 else
if dayofweek(currentdate) = 1 then {YourDateField} = CurrentDate-2 else
if dayofweek(currentdate) = 2 then {YourDateField} = CurrentDate-3

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top