Hi all,
I hope you can help me.
I have a simple calculation error due to, what I believe, is a format issue.
Detail:
i have two fields used for capturing a start and end time - txtWorkShiftStart and txtWorkShiftEnd. The format of these two fields are HH:MM. To calculate the total shift time, one would subtract the two values (End - Start).
Here is the code i use for the calculation:
This seems to work fine, until you have a shift starting before 00:00 (midnight) and end after 00:00 (midnight).Please Login or Register to view this content.
Example:
04:00 - 20:00 = 16:00 WRONG REMEMBER: it is a shift that started at 20:00 and ended 04:00 the next morning
It should be :
04:00 - 20:00 = 08:00 CORRECT REMEMBER: it is a shift that started at 20:00 and ended 04:00 the next morning
i thank you in advance!
Bookmarks