Solved

Count function in Crystal

Posted on 2008-10-23
10
1,138 Views
Last Modified: 2011-10-19
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.
0
Comment
Question by:michaelheffernan
  • 6
  • 4
10 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 22792069
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
0
 

Author Comment

by:michaelheffernan
ID: 22797940
Hmmmmm.... lemme think about this 'un...
0
 

Author Comment

by:michaelheffernan
ID: 22800211
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?
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 100

Expert Comment

by:mlmcc
ID: 22800615
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
0
 

Author Comment

by:michaelheffernan
ID: 22817498
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
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 125 total points
ID: 22819068
You need to choose a DATE field.

mlmcc
0
 

Author Comment

by:michaelheffernan
ID: 22827200
Ah, oops, yes.  Okay, lemme try it...
0
 

Author Comment

by:michaelheffernan
ID: 22827213
Ah, I see, I see, sayeth the blind man.  Okay, thanks, I believe I can sort this out; thank you.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22854400
WHy accept that comment as the answer when the comment from the expert is the answer.  

mlmcc
0
 

Author Closing Comment

by:michaelheffernan
ID: 31509479
Thank you.  I probably clicked the wrong link or wrong comment to accept as a solution.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question