Finding time between 2 dates considering working hours

  • Hi All.

    I have a scenario in which i need to calculate the time consumed by the user to do a task.

    suppose Start Time is : 2012-03-14 10:00 am

    and End Time is : 2012-03-15 10:am

    and working hours is 7 am to 2 pm

    then result should be : 7 hours and not 24 hrs.

    I know i did to use DateDiff with case statement but i am not able to frame by T-SQL statements.

    Thanks.

  • Please don't cross post. It just wastes peoples time and fragments replies.

    No replies to this thread please. Direct replies to: http://www.sqlservercentral.com/Forums/Topic1267335-392-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 1 (of 1 total)

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