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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Difference between Times with dates
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

asif372
Posting Yak Master

Pakistan
100 Posts

Posted - 01/27/2013 :  05:57:36  Show Profile  Reply with Quote
i want disserence between 2 datetime fields
how can it be possible
my data is like this

ID---- Timein------------------- TimeOut----------------
1-----2013-10-13 08:27:00.000--- 2013-10-13 16:12:00.000
2-----2013-10-14 18:00:00.000--- 2013-10-15 05:00:00.000
3-----2013-10-14 19:00:00.000--- 2013-10-15 07:00:00.000
4-----2013-10-14 19:15:00.000--- 2013-10-15 10:18:00.000
5-----2013-10-15 18:10:00.000--- 2013-10-16 06:55:00.000
5-----2013-10-15 19:10:00.000--- 2013-10-16 07:40:00.000

i want difference between Timein and Time Out as above data show's date change between timein and timeout how can it be possible
Thanks in advance

webfred
Flowing Fount of Yak Knowledge

Germany
8760 Posts

Posted - 01/27/2013 :  07:04:02  Show Profile  Visit webfred's Homepage  Reply with Quote
you can use DATEDIFF()


Too old to Rock'n'Roll too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 01/27/2013 :  13:52:43  Show Profile  Reply with Quote
you want date difference in what format? Show your expected output for above data

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.03 seconds. Powered By: Snitz Forums 2000