I am trying to create a report that will show me ticket that are outside of the SLA times. Urgent tickets have a completion SLA of 6hrs and High tickets have a completion time of 4hrs.

The following is the code I have, however the issue seems to be in trying to get crystal to understand the hours. The duration is being printed in minutes, and no matter what variation I use to represent hours it seems to choose what it likes. This code results in two tickets obviouly under the SLA at 11 minutes and 23 minutes showing as out of SLA.

Any suggestions for help would be greatly appreciated.

AssignDuration Formula:
stringvar AssignDuration;

if {ASGNMNT.RESOLUTION} = "Open" then AssignDuration := totext(DateDiff("h", {@Assigned_ACK_DateTime}, CurrentDateTime))

else AssignDuration := totext((datediff ("n", {@AssignDateTime}, {@AssignResolved})));

AssignDuration

SLANotes Formula:
stringvar SLANotes;

if {CALLLOG.PRIORITY} = "1-Urgent" then

(
if {@AssignDuration} < "4" then (SLANotes := "Within SLA")
else SLANotes := "Out of SLA"
)

else

if {CALLLOG.PRIORITY} = "2-High" then

(
if {@AssignDuration} < "6" then (SLANotes := "Within SLA")
else SLANotes := "Out of SLA"
);

SLANotes

Thanks,

Kerry.