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
 time differece

Author  Topic 

jeff06
Posting Yak Master

166 Posts

Posted - 2007-02-07 : 09:50:59
hwo to get the month different to two time
say between 12-21-1965 and 8/10/2005? by sql?
THX

Jeff

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-02-07 : 09:52:58
Just in time!
See this topic http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=78730


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

jeff06
Posting Yak Master

166 Posts

Posted - 2007-02-07 : 10:06:11
thank
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-02-07 : 10:08:20
A bit over kill isn't it

just use datediff(month, '19651221', '20050810')


KH

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-02-07 : 10:51:23
476 months with DATEDIFF.
475 months (and 20 days apart) with function in link.

A very little difference.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

jeff06
Posting Yak Master

166 Posts

Posted - 2007-02-07 : 16:39:40
Thanks
Go to Top of Page
   

- Advertisement -