Hi all
Maybe I am tried, need a vacation, or to take my meds, but in any case I am lost. The following code gives me 2 different calculation results for my DateTime Fields
The field cFromDateTime is data-entered as 15/08/2007 08:45:00 AM and cToDateTime is data-entered as 15/08/2007 09:15:00 AM. This gives me the following results:
4a 1800
4b 29 60
5 59 1
But when field cFromDateTime is data-entered as 15/08/2007 12:00:00 AM and cToDateTime is data-entered as 15/08/2007 12:30:00 AM. This gives me the following correct results:
4a 1800
4b 30 0
5 0 0
lnTotalSecs = EVALUATE(THIS.cToDateTimeField) - EVALUATE(THIS.cFromDateTimeField)
WAIT WINDOW "4a" + STR(lntotalsecs)
lnMins = INT(lnTotalSecs / (1 * 60))
lnTotalSecs = lnTotalSecs - (lnMins * 60)
WAIT WINDOW "4b" + STR(lnmins) + STR(lntotalsecs)
lnSecs = INT(lnTotalSecs / (1))
lnTotalSecs = lnTotalSecs - (lnSecs)
WAIT WINDOW "5" + STR(lnsecs) + STR(lntotalsecs)
What should it be rest, vacation or meds :) ?