Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Being right is highly overrated. Even a stopped clock is right twice a day
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!


How Do I Report the Previous Days Data in Crystal Reports?

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


Name *

Email Address *

Comment *

To prove you are human what is:

33 + 4 =