Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Cumulative Days With Multiple Begin End Dates Post Reply Post New Topic
<< Prev  Page  of 2
Author Message
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 09 Oct 2012 at 6:48am
Hi
 
I really don't understand why we need to take one more table with calendar date, link it and count the dates.
 
Even if the dates are repeted, distinctcount will give you correct count. 
 
I have replicated at my end with group and distinctcount and it is working fine.
 
 
Thanks,
Sastry
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Oct 2012 at 7:22am

unless I am missing something the option you suggested of using

distinctcount(date,group) will give a count of the value in the field
 
What mrstacy wanted was a distinctcount of the range of days covered by the enrollment.
using the opriginal sample data of
TYPE          START             END
algebra     1-1-2012        1-10-2012
science     1-4-2012        1-11-2012
english      1-9-2012        1-13-2012
 
distinctcount of the startdate would be 3
distinctcount of the enddate would be 3
but the request was for a distinct count of every day that was "covered" by an enrollment into a class.
13 days (1-1-2012 to 1-13-2012)
using a claendar table for every day lets the join do all of the work in finding any gaps or overlaps.
HTH
 
 
IP IP Logged
mrstacy
Newbie
Newbie
Avatar

Joined: 04 Oct 2012
Online Status: Offline
Posts: 9
Quote mrstacy Replybullet Posted: 10 Oct 2012 at 4:38am
DBlank.  Yes.  Your understanding is correct.  Problem solved.
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 10 Oct 2012 at 7:05pm
Hi
 
 
Thank you so much for detailed explanation.  I thought series of dates, but it was range dates.
 
 
Help :   I would like see the threads which I answered through search.  Because, I am answering some threads and not able to follow them or answer futher.
Thanks,
Sastry
IP IP Logged
<< Prev  Page  of 2
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