Home » SQL & PL/SQL » SQL & PL/SQL » to calculate exact year of experiance for employee (oracle 9i)
to calculate exact year of experiance for employee [message #422523] Thu, 17 September 2009 02:18 Go to next message
vivek_rol
Messages: 65
Registered: February 2009
Member
hi all,
i want to calculate exact year of experiance for employee

suppose emp recrute on 01-jan-2008

then query has to return his exp as 1-year-9 month 16 day

please suggest the method to calculate in this way for all emp
Re: to calculate exact year of experiance for employee [message #422526 is a reply to message #422523] Thu, 17 September 2009 02:21 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
How to get the difference between 2 dates in format years/months/days

Regards
Michel
Re: to calculate exact year of experiance for employee [message #422536 is a reply to message #422523] Thu, 17 September 2009 05:49 Go to previous messageGo to next message
QuickGun
Messages: 8
Registered: September 2009
Location: SG
Junior Member
An example. Thought could help you.

SELECT round((SYSDATE - TO_DATE('20080101','yyyymmdd'))/365,1) FROM dual;

[Updated on: Thu, 17 September 2009 05:52]

Report message to a moderator

Re: to calculate exact year of experiance for employee [message #422545 is a reply to message #422536] Thu, 17 September 2009 06:33 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
How does this output in format: "1-year-9 month 16 day"?
And a year is NOT 365 days.

Regards
Michel
Re: to calculate exact year of experiance for employee [message #422655 is a reply to message #422545] Fri, 18 September 2009 02:41 Go to previous messageGo to next message
QuickGun
Messages: 8
Registered: September 2009
Location: SG
Junior Member
oops... you are right.

my query can only answer the below quote.

Quote:

i want to calculate exact year of experiance for employee


will get back if found any solution to this... Smile

<<Apologies for incomplete answer. Embarassed >>
Re: to calculate exact year of experiance for employee [message #422660 is a reply to message #422655] Fri, 18 September 2009 03:12 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
will get back if found any solution to this...

Just click on the link I provided. Wink

Regards
Michel
Previous Topic: procedure in select
Next Topic: How to convert MM/DD/YYYY time format to YYYY-MM-DDTHH:mm:ss.000Z (merged 3)
Goto Forum:
  


Current Time: Sun Dec 04 04:40:10 CST 2016

Total time taken to generate the page: 0.12129 seconds