The issue:
A delegate during a training session, wanted to know how she could return the previous days data when running a report in Crystal Reports.
The solution:
Using the Select Expert in Crystal Reports, the select criteria would be:
{Tablename.Fieldname} = CurrentDateTime -1
However, this is fine if the company runs 7 days a week, as it turns out the organisation, runs on a working week, so the above formula needs to be moified, that when running the report on Monday, it only returns the previous Friday data:
IF DayofWeek(CurrentDateTime) = 2
THEN {Tablename.Fieldname} = CurrentDateTime -3 Else {Tablename.Fieldname} = CurrentDateTime -1
If you have any questions, leave us a comment below, or need any assistance, please do not hesitate to Contact Us |