Originally posted by DBlank what is your formula for calculating the datediff?
NumberVar TotalDays;
NumberVar TotalWeekEndDays;
NumberVar SecondsTook;
NumberVar HoursTook;
NumberVar DaysTook;
StringVAR TimeTaken;
TimeTaken := "No Dates";
TotalWeekEndDays := (DateDiff( "ww", {#SoCommentDateRt},{#MemApptDateRt},2)*2);
// Calculate work days took
TotalDays := Round((DateDiff( "d", {#SoCommentDateRt},{#MemApptDateRt},2) - TotalWeekEndDays ),0);
HoursTook:= (DateDiff( "h", {#SoCommentDateRt},{#MemApptDateRt},2));
SecondsTook:= (DateDiff( "s", {#SoCommentDateRt},{#MemApptDateRt},2));
if SecondsTook = 0 Then
TimeTaken := ("Open")
else if (TotalDays) > 0 Then
TimeTaken := (TotalDays & " Day/s")
else if HoursTook > 0 Then
TimeTaken := (HoursTook & " HOUR/S")
else
TimeTaken := ("15 minutes") ;
I probably will edit it and have anything < 1 Day just rounded up to '1 day' and anything = 0 Seconds '0'Edited by Ohmsy - 13 Jul 2010 at 3:37am