Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Time Parameter Not Working Post Reply Post New Topic
Page  of 2 Next >>
Author Message
T-La
Newbie
Newbie
Avatar

Joined: 23 Jul 2009
Location: United States
Online Status: Offline
Posts: 7
Quote T-La Replybullet Topic: Time Parameter Not Working
     Posted: 23 Jul 2009 at 9:18am
I am new to Crystal Reports and I work for a call center. I am trying to write a formula that let me pull the numbers calls based time. Which right now is our business hours 7am-9 m M-F and Sat 9-1.  Here is the formula that I have written and the problem is that I am getting tiimes outside of the time range. For example 12:00 AM ???  Please help.....
 
If Time({HSVCCLASSSUMMARY.INTERVALSTART}) >= time("7:00am") and Time({HSVCCLASSSUMMARY.INTERVALSTART}) <= time("9:00pm") then
{HSVCCLASSSUMMARY.INTERVALSTART}
T-La
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Jul 2009 at 9:46am
if timevalue({HSVCCLASSSUMMARY.INTERVALSTART}) in timevalue(#07:00:00#) to timevalue(#21:00:00#) then ({HSVCCLASSSUMMARY.INTERVALSTART})
although if you get rid of the if - then and use it in the select statement than you can just do a record count ...
timevalue({HSVCCLASSSUMMARY.INTERVALSTART}) in timevalue(#07:00:00#) to timevalue(#21:00:00#)
or if you make it a 1 and 0 then you can sum this formula...
if timevalue({HSVCCLASSSUMMARY.INTERVALSTART}) in timevalue(#07:00:00#) to timevalue(#21:00:00#) then 1 else 0
IP IP Logged
T-La
Newbie
Newbie
Avatar

Joined: 23 Jul 2009
Location: United States
Online Status: Offline
Posts: 7
Quote T-La Replybullet Posted: 23 Jul 2009 at 10:52am
I tried the code and it did not show the times that call came in.  It just shows blank. ???
T-La
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Jul 2009 at 11:02am
1. What is the field type for HSVCCLASSSUMMARY.INTERVALSTART?
2. What are a few sample pieces of data?
3. Which of the 3 above options did you try?
Here is a process to test the formula...
pull all the rows intot he report.
add a fomula field as:
timevalue({HSVCCLASSSUMMARY.INTERVALSTART}) in timevalue(#07:00:00#) to timevalue(#21:00:00#)
Place it on the detail row. It should show a True value when the time is between 7 am and 9 pm and FALSE any other time.
Did it do that? If not what did it do?
 
IP IP Logged
T-La
Newbie
Newbie
Avatar

Joined: 23 Jul 2009
Location: United States
Online Status: Offline
Posts: 7
Quote T-La Replybullet Posted: 23 Jul 2009 at 1:19pm
It is a datetime field.
12:00 am 16-July-2009
Channel.Voice.Language.English,Intent.Admin   
False    14  0 14  3  0 0 208  100%
False    14 0 14   0  0  0  98  100%
 
I tried them all.
It did not return and times or dates just the rows after False. 
The above data is what I got when entered the formula for the true or false. ????
T-La
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Jul 2009 at 1:27pm

How I am interpreting your last post is that there are no records that have a time value between 7-9.

Place the field on your canvas and format it to only show the time (right click, select format Field, select DAte and TIme tab, click on the 13:23 option).
are there any values that actually fall between 7 and 21 (aka 9 pm)?
IF not then you are using the wrong data field to get your time value.
IP IP Logged
T-La
Newbie
Newbie
Avatar

Joined: 23 Jul 2009
Location: United States
Online Status: Offline
Posts: 7
Quote T-La Replybullet Posted: 23 Jul 2009 at 1:50pm

When I do that I get two dates and times in the Design/Preview field that read like this:

7/16/2009 12:00AM
7/16/2009 12:00 PM
They have plus signs next them so when I expand it , it shows a list of queues.  What it seems to me is that the AM queues are wrong and the PM queues are right.  I hope I amking sense. 
 
I also did what you said I see and in the AM I get
0:00
1:00
1:30
0:30
then I page through the report and I get
21:00
21:30
22:00
But I am starting to think that maybe I am using the field. 
 
T-La
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Jul 2009 at 1:58pm

I am at a loss on how to assist right now. I think the issue has to do with the data field you are using.

If you need more assistance please feel free to post more info for more help.
Sorry it was not an easy solution Confused
IP IP Logged
T-La
Newbie
Newbie
Avatar

Joined: 23 Jul 2009
Location: United States
Online Status: Offline
Posts: 7
Quote T-La Replybullet Posted: 23 Jul 2009 at 2:40pm

Thank you for all help. What I figured out is that there must be something thtat the backend is not doing. Because I am not getting any AM calls andd he PM calls I validated are.  But thanks for all your help greatly appreicated.Wink 

T-La
IP IP Logged
T-La
Newbie
Newbie
Avatar

Joined: 23 Jul 2009
Location: United States
Online Status: Offline
Posts: 7
Quote T-La Replybullet Posted: 26 Aug 2009 at 9:44am
I need to do a datetime conversion from UTC to CST without having to hard code the date any suggestions.
T-La
IP IP Logged
Page  of 2 Next >>
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