Hi - We are trying to retreive mins of a call being openned in Crystal
See the formula below. It is not working correctly. Does anyone see the problem and the way we can fix it.
Local numbervar SubmitH:=Hour({HPD_Help_Desk.Submit Date});
Local numbervar SubmitM:=Minute({HPD_Help_Desk.Submit Date});
Local datevar SubmitDay:=date({HPD_Help_Desk.Submit Date});
Local DateTimeVar Submit;
Local numbervar ResolveH:=Hour({HPD_Help_Desk.Last Resolved Date});
Local numbervar ResolveM:=Minute({HPD_Help_Desk.Last Resolved Date});
Local datevar ResolveDay:=date({HPD_Help_Desk.Last Resolved Date});
Local DateTimeVar Resolve;
WhileReadingRecords;
If SubmitH < 9 then (SubmitH:=9; SubmitM:=0);
If SubmitH > 17 then (SubmitH:=9; SubmitM:=0; SubmitDay:=date({HPD_Help_Desk.Submit Date}) + 1);
If Dayofweek(SubmitDay)= 1 then (SubmitH:=9; SubmitM:=0; SubmitDay:=date({HPD_Help_Desk.Submit Date}) + 1);
If Dayofweek(SubmitDay)= 7 then (SubmitH:=9; SubmitM:=0; SubmitDay:=date({HPD_Help_Desk.Submit Date}) + 2);
If ResolveH < 9 then (ResolveH:=9; ResolveM:=0);
If ResolveH > 17 then (ResolveH:=9; ResolveM:=0; ResolveDay:=date({HPD_Help_Desk.Last Resolved Date}) + 1);
If Dayofweek(ResolveDay)= 1 then (ResolveH:=9; ResolveM:=0; ResolveDay:=date({HPD_Help_Desk.Last Resolved Date}) + 1);
If Dayofweek(ResolveDay)= 7 then (ResolveH:=9; ResolveM:=0; ResolveDay:=date({HPD_Help_Desk.Last Resolved Date}) + 2);
Submit:=DateTime(year({HPD_Help_Desk.Submit Date}),Month({HPD_Help_Desk.Submit Date}),day(SubmitDay),SubmitH,SubmitM,0);
Resolve:=DateTime(year({HPD_Help_Desk.Last Resolved Date}),Month({HPD_Help_Desk.Last Resolved Date}),day(ResolveDay),ResolveH,ResolveM,0);
DateDiff("n",Submit,Resolve)-(((DateDiff("ww",SubmitDay,ResolveDay,crSaturday)*8*60)+ (datediff("ww",SubmitDay,ResolveDay,crSunday))*8*60)+ (datediff("d",SubmitDay,ResolveDay)*16*60))
we then truncate the mins into hours and mins as so:
local numbervar Hr := Truncate(
{@mins to Resolve}/60);
local numbervar Mn := Remainder(
{@mins to Resolve},60);
this also does not seem to be producing the desired result.
any help would be grateful
Rick