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(var char(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.
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(var
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.
ASKER
Hmmmmm.... lemme think about this 'un...
ASKER
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?
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
mlmcc
GroupingByDate.jpg
ASKER
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ah, oops, yes. Okay, lemme try it...
ASKER
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
mlmcc
ASKER
Thank you. I probably clicked the wrong link or wrong comment to accept as a solution.
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