| Author |
How to find out number of years worked using sql
|
Pol Appan
Ranch Hand
Joined: Aug 26, 2004
Posts: 144
|
|
Hello, How to find from a table which has hiredate and should return number of years worked with range like 0-5, 5-10,10-15 etc. Any help is highly appreciated. Thanks
|
Never take anything for granted because you never know when you will lose it
|
 |
Joel McNary
Bartender
Joined: Aug 20, 2001
Posts: 1815
|
|
|
What database are you using? Date functions are often db-specific, so we'd need to know that.
|
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
|
 |
Scott Selikoff
Saloon Keeper
Joined: Oct 23, 2005
Posts: 3652
|
|
|
Are you trying to do it in a single SQL statement or in PLSQL such as in a stored procedure? Also is the range part of the input parameters? Such as if I set 7 it should do 0-7, 7-14, etc instead of increments of 5?
|
My Blog: Down Home Country Coding with Scott Selikoff
|
 |
Pol Appan
Ranch Hand
Joined: Aug 26, 2004
Posts: 144
|
|
I am using Oracle 9i and not using pl/sql, plain sql. Thanks
|
 |
 |
|
|
subject: How to find out number of years worked using sql
|
|
|