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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-01-24 : 08:45:55
|
| Chris writes "I am trying to get the difference between two dates as a decimal. The SQLSERVER DateDiff function rounds to an even whole number year. Here is what I have triedDATEDIFF(year, dd.hire_date, getdate()) as YearsOfServiceI'd like to see the result as .17, 2.75.Thank you,Chris" |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-01-24 : 09:15:02
|
select convert(decimal(12,2), DATEDIFF(m, dd.hire_date, getdate())/12.00) as YearsOfServiceGo with the flow & have fun! Else fight the flow |
 |
|
|
|
|
|