Please start any new threads on our new site at 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
Save Password
Forgot your Password?

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

Posting Yak Master

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

Flowing Fount of Yak Knowledge

8781 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

Very Important crosS Applying yaK Herder

52326 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

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.02 seconds. Powered By: Snitz Forums 2000