Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying No.Of Days Experience

Status
Not open for further replies.

kiranjasti

Programmer
Feb 22, 2002
4
US

Hi Buddies,
I have a small doubt. Can any of u help me out in this regard

I hope Everybody knows about the EMP Table.
I want to use the hiredate of the employee.
My requirement is to display his/her experience in days

For Example
If he has 400 days of experience then my output Should be like this

Experience of the Employee
-----------------------
1 Year 1 Month 4 Days

Could you please let me know how to do this

Thanks in Anticipation

Regards
Kiran Kumar Jasti
 
This should works assuming that your date mathematics returns its answer in the of DAYS.

The solution to your problem is the Modulus ( Mod )

In Oracle pseudo code:

select trunc( (sysdate - hiredate)/365, 0 ) || ' Years', trunc( Mod((sysdate - hiredate), 365), 0 ) || ' Days'
from yourtable
where condition = your_condition
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top