PauloMongo
Programmer
Hi,
I have two dates, start date, end date, both are date/time values.
eg.
Start - 02/09/2004 10:59:39
End - 06/09/2004 10:13:07
Working Periods
Work days - Monday to Friday
Work hours - 8am to 6pm.
I need to create a formula that works out the difference in minutes between these two dates that fall into my working days periods.
I am currently using this formula, but it does not take into account my periods.
Local DateVar DateStart:=cdate({V_SERVICE_CALL.EARLY_START});
Local DateVar DateFinish:=cdate({V_SERVICE_CALL.EARLY_FINISH});
Local TimeVar TimeStart := TimeValue({V_SERVICE_CALL.EARLY_START});
Local TimeVar TimeFinish := TimeValue({V_SERVICE_CALL.EARLY_FINISH});
local numbervar Minutes := DateDiff("n", DateTimeValue(DateStart,TimeStart), DateTimeValue(DateFinish,TimeFinish));
ToText(Truncate(Minutes/60)) + " hours(s), " + ToText(Remainder(Minutes,60)) + " minutes(s)"
ANY HELP WOULD BE GREATLY ACCEPTED.
Thanks,
Paul
I have two dates, start date, end date, both are date/time values.
eg.
Start - 02/09/2004 10:59:39
End - 06/09/2004 10:13:07
Working Periods
Work days - Monday to Friday
Work hours - 8am to 6pm.
I need to create a formula that works out the difference in minutes between these two dates that fall into my working days periods.
I am currently using this formula, but it does not take into account my periods.
Local DateVar DateStart:=cdate({V_SERVICE_CALL.EARLY_START});
Local DateVar DateFinish:=cdate({V_SERVICE_CALL.EARLY_FINISH});
Local TimeVar TimeStart := TimeValue({V_SERVICE_CALL.EARLY_START});
Local TimeVar TimeFinish := TimeValue({V_SERVICE_CALL.EARLY_FINISH});
local numbervar Minutes := DateDiff("n", DateTimeValue(DateStart,TimeStart), DateTimeValue(DateFinish,TimeFinish));
ToText(Truncate(Minutes/60)) + " hours(s), " + ToText(Remainder(Minutes,60)) + " minutes(s)"
ANY HELP WOULD BE GREATLY ACCEPTED.
Thanks,
Paul