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 |
|
seth666
Starting Member
2 Posts |
Posted - 2006-03-09 : 05:16:19
|
| I have data in table in days. I need to convert it to years, months days...sample:6868 days -> ?years, ?months, ?daysThank you......And justice for all |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-03-09 : 05:48:14
|
| Hi seth666, Welcome to SQL Team!Depends on Leap Years doesn't it?And if you start from 1st January you'll get a different number of months than if you start from 1st February!!Kristen |
 |
|
|
seth666
Starting Member
2 Posts |
Posted - 2006-03-09 : 07:01:20
|
| Yes I know. I need this for calculating peoples working years. I have all data in days....Any Idea?...And justice for all |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-03-09 : 07:23:42
|
if you don't have a start date you're in trouble...i guess you could do something like if weekends aren't counted in days number:6668/5 = w = how many weeks w/52 = y = yearsthis is of course far from accurate...Go with the flow & have fun! Else fight the flow |
 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2006-03-09 : 07:45:50
|
Is it how many days worked or how many days since they started?If it's how many day since they started, you could do: dateadd(dd,-6868,getdate()) to get their start date.. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|