Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Sum Up TimeOut - TimeIn As total workhours
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gingank
Starting Member

1 Posts

Posted - 10/07/2012 :  21:25:19  Show Profile  Reply with Quote
Could anyone help me on this?
My database design as like this:-
Name(varchar)
TimeIn(Varchar)
TimeOut(Varchar)

Output:
NAME TIMEIN TIMEOUT Totalworkhour
LEE 08:15 18:15 10

How could i calculate it so that it will display total work hours = 10 HOURS ?

senthil_nagore
Flowing Fount of Yak Knowledge

India
1007 Posts

Posted - 10/08/2012 :  01:09:51  Show Profile  Visit senthil_nagore's Homepage  Send senthil_nagore a Yahoo! Message  Reply with Quote
Try this

Select datediff(hh,cast(TimeIn as smalldatetime),cast(TimeOut as smalldatetime))

Senthil Kumar C
------------------------------------------------------
MCITP - Database Administration SQL SERVER 2008
MCTS - Database Development SQL SERVER 2008
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000