Oracle: Hire_date column subtracted from SYSDATE column. What is the meaning of the output?

What I'm looking at for this question
For the sysdate - hire_date "Months Worked" column, I don't understand what the '9585' means. Is it months? I calculated 9585/12 but that doesn't make sense because that gives me 798. Can anyone tell me what that means? Thanks
Mark_CoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gerwin Jansen, EE MVETopic Advisor Commented:
9585 are days :)

Divide by 365 and you get 26.26 (years) 1987 - 2013 is roughly 26 years
0
sdstuberCommented:
if you'd like the results in months you could use

months_between(sysdate,hire_date)
0
Mark_CoAuthor Commented:
@gerwinjansen No I understand that part but what is the column systohire of 314 ( in the first row) telling me?
0
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

Mark_CoAuthor Commented:
Sorry I should've said that
0
Mark_CoAuthor Commented:
You have now confirmed that the 9585 is days but what I'm after truly is trying to understand what that 314 means
0
Mark_CoAuthor Commented:
Again, I'm sorry for not being detailed enough
0
Gerwin Jansen, EE MVETopic Advisor Commented:
systohire is just the column name for the result of the function months_between (with 2 parameters: sysdate (or now) and the hire_date column). It is the amount of months between the 2 dates. For the first row in you result 314 is the amount of months between 'now' (sysdate) and hire_date.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PortletPaulfreelancerCommented:
Column 2 "Months Worked"
when subtracting one date from another, the unit returned is expressed in days
(the fractional part works down to seconds I'm pretty sure)

column 3
you get an integer result from the calculation involving TRUNC() because  "time" is removed from both dates i.e. both dates are set to a time of 00:00:00

Column 6 "systohire"
is the result of the function months_between() and as that function name indicates it is returning the unit months. (the fractional part accounts for days, might be more fine grained - don't remember that bit)

No points pl.
0
Mark_CoAuthor Commented:
I feel so stupid right now. I was doing 9585/12 when I should have been doing 9585/30(days in a month). Now I see where the numbers came from
0
sdstuberCommented:
if you were looking for the number of months between the dates
then shouldn't the months_between post get a split?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.