what is the output of datediff function in sqlserver 2005

Posted by Sheeba under ASP.NET on 11/2/2010 | Points: 10 | Views : 3932 | Status : [Member] | Replies : 4
Hi

what is the output of datediff function in sqlserver 2005

SELECT DATEDIFF(year, 1, GETDATE())

The output of above function is 110.. hw its possible?




Responses

Posted by: Lalji_mer on: 11/2/2010 [Member] Bronze | Points: 25

Up
0
Down
Hi,

This link might be help you,

http://www.informit.com/articles/article.aspx?p=31453

LP MER

Sheeba, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vpramodg on: 11/2/2010 [Member] Starter | Points: 25

Up
0
Down

I think this link will help you
http://msdn.microsoft.com/en-us/library/ms189794.aspx

pramod.v.g

Sheeba, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prasham on: 11/5/2010 [Member] Starter | Points: 25

Up
0
Down
Hello,

Please go through following links

http://msdn.microsoft.com/en-us/library/aa258269%28SQL.80%29.aspx
http://www.sqlteam.com/article/datediff-function-demystified

Thanks and Best Regards
Prasham

Sheeba, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 11/5/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
The DateDiff gives you a Difference between two dates. To get the Difference between today and 31 Dec 2010 you can do something like


SELECT DATEDIFF(DAY, GETDATE(),'2010-12-31 00:00:00')


Thank you for posting at Dotnetfunda
[Administrator]

Sheeba, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response