Print Page | Close Window

Group by range of dates

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15220
Printed Date: 21 May 2024 at 9:52am


Topic: Group by range of dates
Posted By: WWUDAVE
Subject: Group by range of dates
Date Posted: 22 Dec 2011 at 5:51am
I am new to Crystal Reports 2008 and have not been able to find a solution to this:
 
I have a table of events. Each record has a start date and an end date. Many events occur over a range of dates.
 
I want to print a calendar of events, in date order. (every event that occurs on each date)
 
Since the only dates stored in the table are the start and end dates, I need a way to print each event on the report for each day that it occurs. To print based on the date range, rather than the start or end date. i.e. if the event starts on 12/22/2011 and ends on 12/24/2011, I need it tp appear on the calendar on 12/22, 12/23 and 12/24.
 
??
 



Replies:
Posted By: hilfy
Date Posted: 28 Dec 2011 at 12:05pm
You'll need to have some sort of calendar table that has all of the dates in it.  You would then join from the event table to the calendar table on the calendar date field between the event start date and the event end date.  Use the calendar date on the report instead of the event dates and you should get one record for each day where an event took place.
 
-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