Crystal Reports 10 - Report Development - HELP! (1 Viewer)

Badam

New member
Local time
Today, 06:59
Joined
Nov 19, 2010
Messages
2
Hi,
I am trying to develop a report that will identify the number of queries that have been closed within a specific time period i.e. I want to report on the number of queries that were closed in less than 24 hrs for example?

I have been trying to do this using a combination of formula fields such as @Call Date, @Closure Date, @Call Time & @Closure Time in the Call Table (Call_HDW) but to no avail.

I'm a bit of a newby when it comes to report development so any pointers would be greatly appreciated!

Thanks in advance
Badam
 

boblarson

Smeghead
Local time
Yesterday, 22:59
Joined
Jan 12, 2001
Messages
32,059
Badam:

I don't have CR available to me at this point (I used it extensively a few years ago) but I seem to remember that there was a DATEDIFF (or DateDif) function that you could use (much like in Access).

I just Googled it and it is:

DateDiff (intervalType, startDateTime, endDateTime)

So if you have a field with date/time stored together that is the best. So you could create a function to return a value of 1 or 0 and then sum them in the Group Footer.
Code:
[/FONT]
[FONT=Arial]If DateDiff("h", {Call_HDW}.{StartDateTimeFieldName},{Call_HDW}.{EndDateTimeFieldName}) > 24 Then[/FONT]
[FONT=Arial]   1[/FONT]
[FONT=Arial]Else[/FONT]
[FONT=Arial]   0[/FONT]
[FONT=Arial]


And then you can
 

Badam

New member
Local time
Today, 06:59
Joined
Nov 19, 2010
Messages
2
Thanks for that Bob - that seems to have worked for me!
One question I would have is : - I was playing about with Parameter Fields to make the report slightly more dynamic i.e. the end user could specify the time frame, for example show me how many queries have been closed in 3 hrs / 9 hrs / 15 hrs etc. Would you have any ideas on this?

What you have provided me with is great - it will certainly suffice for the moment. Any pointers on the above would be greatly appreciated.

Cheers,
Badam
 

boblarson

Smeghead
Local time
Yesterday, 22:59
Joined
Jan 12, 2001
Messages
32,059
I can't remember how you set the input parametes exactly but you should be able to substitute

> 24

with

> @InputNameHere

and set up a parameter in the parameters area. Again, I don't have it here with me so I can't really tell you how to get there.
 

Users who are viewing this thread

Top Bottom