Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Computers are useless. They can only give you answers
 
Pablo Picasso
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!!!!

12
September

How Do I Calculate the Week Commencing Date from the previous year ago in Crystal Reports?

I was recently asked during a Crystal Reports XI training session, "How do I calculate the week commencing date for the same date from the previous year?"

Using a formula the delegate wanted to be able to calculate the date for the Monday of the equivalent week to the current week a year ago.

For example using the date Tuesday 13th September 2011, the formula should return the week commencing date as Monday 13th August 2010.

 

Solution:

This can be achieved using, various Date Time functions, to produce the following formula:

DateSerial(Year(CurrentDate) - 1, Month(CurrentDate), Day(CurrentDate) - (DayOfWeek(DateAdd('yyyy', -1, CurrentDate), CRTuesday)))



If you have any questions, leave us a comment below, or need any assistance, please do not hesitate to Contact Us

MAKE A COMMENT

Name *

Email Address *

Comment *

To prove you are human what is:

97 + 32 =