HowardHammerman
Instructor
My client is a plumber and his employees fill out work tickets when they are on a job. All this is entered into an SQL database. The table I am working with has one record per ticket with start datetime and enddatime fields. The task is to calculate regular hours and overtime hours from each ticket. Regular time starts at 8am Monday to Friday and ends at 4pm Monday to Friday. All other days and times are overtime. A ticket can start in regular time and extend into overtime and in that case it needs to be split. Likewise, a ticket can start in overtime and end in regular time. And a ticket can start one day and extend into the next day. Obviously, a ticket started on Saturday or Sunday is OT but can extend into regular time.
I think the trick is to calculate total time:
datedif("h",{table.start},{table.end}) and then subtract either regular time or OT from it.
The solution that solves this in fewer than 40 lines of code wins a prize.
Thanks in advance
Howard Hammerman,
Crystal Training and Crystal Material
On-site classes and one-on-one coaching
Low-cost telephone/email support
I think the trick is to calculate total time:
datedif("h",{table.start},{table.end}) and then subtract either regular time or OT from it.
The solution that solves this in fewer than 40 lines of code wins a prize.
Thanks in advance
Howard Hammerman,
Crystal Training and Crystal Material
On-site classes and one-on-one coaching
Low-cost telephone/email support