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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Difference in date

Author  Topic 

jafrywilson
Constraint Violating Yak Guru

379 Posts

Posted - 2010-10-06 : 05:00:38
Hi all..

How to find the difference of two dates in sql..

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-10-06 : 05:13:37
Using datediff function

Have a look at:
http://msdn.microsoft.com/en-us/library/ms189794.aspx
Go to Top of Page

jafrywilson
Constraint Violating Yak Guru

379 Posts

Posted - 2010-10-06 : 06:00:51
Tnx for the response ..Got some ideas and solved my problem
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-10-06 : 06:04:51
Welcome
Go to Top of Page

jafrywilson
Constraint Violating Yak Guru

379 Posts

Posted - 2010-10-06 : 06:06:24
DATEDIFF(datepart,startdate,enddate) This is the syntax for calculating date difference
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-10-06 : 06:14:48
quote:
Originally posted by jafrywilson

DATEDIFF(datepart,startdate,enddate) This is the syntax for calculating date difference



Yes
Go to Top of Page
   

- Advertisement -