
March 5th, 2004, 01:58 PM
|
|
Contributing User
|
|
Join Date: Mar 2004
Posts: 40
Time spent in forums: 7 h 6 m 35 sec
Reputation Power: 5
|
|
|
how to calculate dates
Hi,
I'm trying to run a query that will return the below output.
EName Years Months
Jim 22 2
This query based on that employees hiredate will determine from the sysdate how many years and months they have been employed. I'm having trouble writing a query that will calculate this. I know a MONTHS_BETWEEN function must be used, and also a TRUNC to grab the remainder of the years which would be the amount of months. I'm having trouble writing this in a query.
I'm a student of SQL, and would appreciate your help.
|