Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Grouping dates within range Post Reply Post New Topic
Author Message
snikpoh.nagol
Newbie
Newbie


Joined: 25 Apr 2012
Online Status: Offline
Posts: 1
Quote snikpoh.nagol Replybullet Topic: Grouping dates within range
     Posted: 25 Apr 2012 at 5:23am
Here is the issue that I am facing..

The report is designed with two date parameters to capture what we call "patients served". That is less technically anyone's ass that touched a bed during the input date range. The record selection criteria is as below:

{EPISODE_HISTORY.PREADMIT_ADMISSION_DATE} <= {?End} and
(isnull({EPISODE_HISTORY.DATE_OF_DISCHARGE}) or
{EPISODE_HISTORY.DATE_OF_DISCHARGE} >= {?Start})

This does works for capturing anyone during the date range, but it ends up having to be run for each month of a year to get a monthly count. Can anyone help with a way to create a range of the dates that could then be grouped by month. So I could run it for a year and then get a monthly count of "patients served" There may be the need for records to be counted in multiple months.

I hope that explanation makes some sense.




IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Apr 2012 at 6:00am
you can use running totals (or shared variable formulas) to conditionally count the records for each month
or
if you do not have dupe rows you can create formulas to insert a 1 or 0 for each month and sum these
or
you could create a custom table with each month (or calendar day) and link your current set to it to create multiple rows of data for counting.
 


Edited by DBlank - 25 Apr 2012 at 6:00am
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum