calculating weekends and holidays hours worked

  • hi experts

    i need to calcutate hours worked on weekends and holidays, my database field are:

    CompletionDate NormalTime Overtime1 Overtime2 Overtime3

    the user captures the date the task was done and how much time was spent, out of that information i need to calculate how much time did the contractor worked on Saturdays,Sundays and holidays

  • Could you tell us how the following fields overtime1, overtime2,overtime3 are required?

    I feel that a single overtime column field would do based on your requirement... Or have you missed out on some important information.?...

    I guess it would be beter if you could provide us a table schema and some data to work with.....it would make life more easier for the rest of us and also a better answer for you.....

  • hi, thanks for prompt response.. here's the database structure:

    ComplDate O/T1 O/T2 StaffName N/T O/T3

    2008-10-23 00Contractor300

    2008-10-29 020Hannes 10 0

    NormalTime (N/T) captures the actual normal work hours work was done so i know if the user captures under the field (N/T) means it's between 7am to 16:00 of normal working hours weekdays, the O/T1,O/T2,O/T3 fields capture work done after hours, weekends and holidays and from these fields i need to do some calculations to determine that

  • First you need to determine what dates are holidays and weekends. Do you have a dates table that defines this information? While it is possible to determine what days are weekends without a dates table you will at least need a holidays table. For example, here in the U.S. today is a holiday, President's Day, so there is no mail and most schools are closed, but for my employer it is a business day, this no overtime, but for others it may overtime, so you need a table that defines holidays for your business. Another example is that my employer gives us the Friday after Thanksgiving as a holiday while other employers do not.

    See the links in my signature for how to post DDL and example data to get the best responses.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply