Print Page | Close Window

showing the date of monday of each week

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=12231
Printed Date: 03 May 2024 at 11:17pm


Topic: showing the date of monday of each week
Posted By: krispie
Subject: showing the date of monday of each week
Date Posted: 03 Feb 2011 at 9:50pm
Hi there,
 
I have created a report to do a break down on a report to show information on customers on a week by week basis. 
 
However I want to show the date of each monday. 
 
So I can show week commencing 01/01/2011. 
 
How do I show this?
 
 



Replies:
Posted By: hilfy
Date Posted: 07 Feb 2011 at 3:43am
Because you're looking for a week that starts on Monday instead of Sunday, you can't just group on the date field and display for every week.  So, I would try creating a formula that looks something like this:
 
If DayofWeek({table.date}, crMonday) > 1 then
  {table.date}-DayofWeek{table.date}, crMonday) + 1
else
  {table.date}
 
This looks at the day number in the week based on the week starting on Monday.  Group on this formula to group your data by week.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window