Gustav Brock
gustav at cactus.dk
Thu Jun 19 11:13:06 CDT 2003
Hi Julie Here's a quick one. For display of the duration: strShift = Format(#23:00# - 1 - #03:00#,"hh:nn") For obtaining an time value: datHours = CDate((Format(#23:00# - 1 - #03:00#,"hh:nn")) What it does is to turn any duration into a positive value. Then Format() does a "modulus 24 hours" behind the scene. Also, look up the recent thread "adding time". /gustav > Have a small problem that I'm hoping someone had encountered. Putting > together a small application to calculate time cards. Running into some > problems with the shift changes. This manufacturing firm uses a 7:00 am to > 7:00 am day running three shifts. I've found several examples for > calculating time cards in the knowledge base, but none seem to address the > fact the "third shift" runs from 11:00 pm to 3:00 am. Of course, this means > that one hour of the shift occurs on one date, and the other seven hours > occur on the following date. I need to test the time input by the clerk and > then based on the start and end times, determine which shift the hours fall > between, then calculate time worked on each shift for each employee. > Employees may clock in and out more than once during a day, and may also > work overtime, as well as spread their hours between more than one shift. > Most of this is already written, however, I am stumpled as to how to handle > the third shift time differential?