Solved

Count function in Crystal

Posted on 2008-10-23
10
1,137 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
 
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now