Link to home
Start Free TrialLog in
Avatar of michaelheffernan
michaelheffernan

asked on

Count function in Crystal

Hi.  I need to do a simple record count in CR.
Fields: an integer, a datetime stamp.
I need a count by day/date/year of events each day:
5813      10/24/2008     7
5813       10/25/2008    6

SQL is a cinch:

SELECT     didnumber,LEFT(CONVERT(varchar(11), starttime, 101),11) as start
into temp1
FROM         CallLog
WHERE     (DIDNumber IN (5290, 5813))

select didnumber,start,count(*) total
from temp1
group by didnumber,start
ORDER BY DIDNumber, Start

How is this done in CR Design?
Thanks.
Avatar of Mike McCracken
Mike McCracken

You can group the report by date 3 times
For the first select the timeframe as YEAR
Second group timeframe is month
third timeframe is day

Then use summaries at the group level to count the events.

mlmcc
Avatar of michaelheffernan

ASKER

Hmmmmm.... lemme think about this 'un...
Hi.  Well, I kinda get the logic.  I don't see how to parse the year/month/day out of this datetime field for each grouping.  CR wants to group the field, period.

How do I parse out each element of the datetime field?
When you create the group, since it is a date field you get an extra option for the interval to group on.

mlmcc
GroupingByDate.jpg
Ah, different version.
 
I do not have such options.  I so rarely have to do something like this that I have never upgraded CR thru its ownership changes.
This may not be possible with this version.

1.jpg
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ah, oops, yes.  Okay, lemme try it...
Ah, I see, I see, sayeth the blind man.  Okay, thanks, I believe I can sort this out; thank you.
WHy accept that comment as the answer when the comment from the expert is the answer.  

mlmcc
Thank you.  I probably clicked the wrong link or wrong comment to accept as a solution.