Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Select/Formula help Post Reply Post New Topic
Author Message
AndreasI
Newbie
Newbie
Avatar

Joined: 29 Jul 2009
Location: Australia
Online Status: Offline
Posts: 8
Quote AndreasI Replybullet Topic: Select/Formula help
    Posted: 13 Aug 2009 at 11:44pm
This is my first post here so please be gentle :)
 
I am designing some reports to support our IT's service management processes (We use ITIL as a framework) and I have been asked to include some information on jobs that are overdue, or will become overdue within 24 hours.
 
I am using the Select Expert to select the expired jobs. That's easy enough, since the SLA_Violated field is a Y/N.
 
However, I'm not sure how to approach the issue of including jobs due to expire within 24 hours.  We do have a "required date" and a "required time" field (2 seperate fields), so I could measure against those 2...but I'm not too sure how to actually do it in crystal. 
 
Any help appreciated.
 
Regards,
 
AndyI
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 14 Aug 2009 at 6:33am
you can declare a variable of type datetime and then concatenate the 2 fields into 1.  You can then use datediff or dateadd to determine if the job will expire in 24 hours.  Something like;
 
local datetimevar aDate:=DateTime({table.duedate},{table.duetime});
if dateadd(h,24,now)>aDate then
 "overdue"
 
there are lots of different ways to accomplish, this is but one.
HTH
IP IP Logged
AndreasI
Newbie
Newbie
Avatar

Joined: 29 Jul 2009
Location: Australia
Online Status: Offline
Posts: 8
Quote AndreasI Replybullet Posted: 24 Aug 2009 at 9:06pm
Thankyou.  As it turns out the view I was using was incorrect and
the view I am now using already has both an SLA expiry field (binary) and a Time To Violation field in the format needed :)
 
Possibly superfluous, but using those 2 fields, I was able to apply some intelligence to my listing of jobs (I couldn't use the previously suggested code properly and need to meet deadlines):
 
if {VIEW.sla_violation}=0 and
dateadd("h",24,CurrentDateTime) > {@Convert Date} then
"Due to expire within 24" else
if {VIEW.sla_violation}=1 then
"SLA Violated"
else
"Not due to expire within 24 hours"
 
Now to set up the summary :)
 
 


Edited by AndreasI - 24 Aug 2009 at 9:09pm
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.