Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
gingank
Starting Member
1 Post |
Posted - 2012-10-07 : 21:25:19
|
Could anyone help me on this?My database design as like this:-Name(varchar)TimeIn(Varchar)TimeOut(Varchar)Output:NAME TIMEIN TIMEOUT TotalworkhourLEE 08:15 18:15 10How could i calculate it so that it will display total work hours = 10 HOURS ? |
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2012-10-08 : 01:09:51
|
Try thisSelect datediff(hh,cast(TimeIn as smalldatetime),cast(TimeOut as smalldatetime))Senthil Kumar C------------------------------------------------------MCITP - Database Administration SQL SERVER 2008MCTS - Database Development SQL SERVER 2008 |
|
|
|
|
|