Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Count on numerous Date Fields Post Reply Post New Topic
Author Message
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Topic: Count on numerous Date Fields
     Posted: 06 Jan 2015 at 11:51pm
Hi Guys,

This seems like a pretty simple thing to do but cannot seem to figure it out.... I have a report that shows the following criteria:

1) Creation Date
2) Update Date
3) Resolution Date

What I want to do now is to count the number of dates in each section. I am expecting to need to 'group' by date but that then throws everything out; for example if I group by 'Creation Date' then the Update/Resolution dates could be wrong as they could have been updated on a different day to the creation.

I am trying to avoid subreports if possible.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Jan 2015 at 3:56am
I dont understand what you are trying to do?
Are these 3 dates on one row of data with a PK like a TicketNumber?
Are these 3 dates on 3 rows with a date type identifier in another field?
What do you mean by "a section"?
Please describe a little more what your data set is and what you are trying to count/accomplish.
Thanks


Edited by DBlank - 07 Jan 2015 at 3:57am
IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 07 Jan 2015 at 4:05am
Hi DBlank,

Sorry; let me try to explain a little better/more comprehensively.

I am reporting on Incidents and am trying to create a report, broken down by Day, which show the number of Incidents Raised/Updated/Closed.

To Group the Incidents I obviously need a date field (e.g. the Raised Date) but if this is used I cannot then count the number that are Updated/Closed.

Consider the following Example...

raw data

Ref - Create Date - Update Date - Resolve Date
1   - 01/01/14    - 01/01/15    - 01/01/15
2   - 03/01/15    - 03/01/15    - 03/01/15
3   - 05/01/15    - 05/01/15    - 06/01/15
4   - 06/01/15    - 07/01/15    - 08/01/15

If I were to then group on Date (Create Date) then I would effectively lose references 3 and 4 from the update/resolved dates.

Hopefully that makes a bit more sense?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Jan 2015 at 6:40am
have you considered a union query
select 'Create' as TicketType,CreateDate as UnionDate from table
UNION
select 'Update' as TicketType, UpdateDate as UnionDate from table
UNION
select 'Resolved' as TicketType, ResolvedDate as UnionDate from table
 
You can then group on the UnionDate field and do counts per TicketType
IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 07 Jan 2015 at 10:06pm
I haven't actually - I will have to look up the syntax for a Union query as I'm not 100% sure what some of the above refers to :-)

thank you.
IP IP Logged
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