How to Calculate OverTime,Full_Day,Half_Day,Late_In,Hours, From INTime and OutTime in a Store Procedure

  • I want to calculate Hours From INTIME and OUTime,
    Day if INTime and Outime Duty Hours is equal to 8 hours than Day =1 ,
    Half Day if INTime and Outime Duty Hours is  to less to 8 hours than Day=0.5,
    IF INTIME Time is equal to or greater then 9:01 day mark as a late and mark 1,
    IF Duty hours is greater then 8 hours then Overtime Amount is calculate, means if Overtime is 12hours then it minus from duty hours from 8 standard Hours and 4hours will be multiply from amount.

  • Can you provide some sample data and expected results please (see the link in my signature on how to do this). Your description is rather vague at best, and with no data or table definition it's impossible for any of the other users here to test or ensure the results are correct. Make sure you include at leat 1 example of each scenario, but 2+ would be far more preferred.

    What have you tried to get the results you're after as well? Please do include a copy of the SQL you tried to get the results you are after when you post your data aswell.

    Thanks.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Thom A - Monday, December 24, 2018 2:45 AM

    Can you provide some sample data and expected results please (see the link in my signature on how to do this). Your description is rather vague at best, and with no data or table definition it's impossible for any of the other users here to test or ensure the results are correct. Make sure you include at leat 1 example of each scenario, but 2+ would be far more preferred.

    What have you tried to get the results you're after as well? Please do include a copy of the SQL you tried to get the results you are after when you post your data aswell.

    Thanks.

    i have attached screen shot

  • akhterhussain80 - Monday, December 24, 2018 3:55 AM

    i have attached screen shot

    Did you have a read of the link in my signature?

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • akhterhussain80 - Monday, December 24, 2018 3:55 AM

    Thom A - Monday, December 24, 2018 2:45 AM

    Can you provide some sample data and expected results please (see the link in my signature on how to do this). Your description is rather vague at best, and with no data or table definition it's impossible for any of the other users here to test or ensure the results are correct. Make sure you include at leat 1 example of each scenario, but 2+ would be far more preferred.

    What have you tried to get the results you're after as well? Please do include a copy of the SQL you tried to get the results you are after when you post your data aswell.

    Thanks.

    i have attached screen shot

    Showing us a picture of your data is like showing a hungry person a picture of food.  Neither one is readily consumable.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • We don't work from screenshots. That's a cumbersome way for us to examine data and test queries.

    Read the link in Thom's signature and post DDL for tables and DML for data.

Viewing 6 posts - 1 through 5 (of 5 total)

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