SQL Server 2008 - Difference between time(0)

Posted by lugeno on Stack Overflow See other posts from Stack Overflow or by lugeno
Published on 2013-06-25T10:00:39Z Indexed on 2013/06/25 10:21 UTC
Read the original article Hit count: 297

Filed under:
|
|

I've a table with working_hours time(0), lunch_hours time(0) What I have to do is the following:

If lunch_hours is greater that one hour, I have to calculate the offset

Example: lounch_hour = 01:30:00 => offset = 00:30:00

Once done I've to subtract the offset from the working_hours value

Example: offset = 00:30:00, working_hours = 07:30:00 => working_hours = 07:00:00

The result must be in time(0) format (hh:mm:ss) I've tried several solutions but still not working. Used DATEDIFF probably didn't used in correct way.

Thanks for any help

Bye!

© Stack Overflow or respective owner

Related posts about sql

Related posts about time