File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to find out number of years worked using sql

 
Pol Appan
Ranch Hand
Posts: 144
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Joel McNary
Bartender
Posts: 1824
Eclipse IDE Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What database are you using? Date functions are often db-specific, so we'd need to know that.
 
Scott Selikoff
author
Saloon Keeper
Posts: 3905
16
Eclipse IDE Flex Google Web Toolkit
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Pol Appan
Ranch Hand
Posts: 144
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Oracle 9i and not using pl/sql, plain sql.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic