21 Nov 2009 
Support Center » Knowledgebase » SQL-Employee Years Of Service Output to excel
 SQL-Employee Years Of Service Output to excel
Solution

The following query returns employees years of service-Output excel. The employees are ordered according to their years of service in decreasing order.

select empl_id, last_name, first_name, date(coalesce(adj_hire_date,date_started)) as date_started,
(now()-coalesce(adj_hire_date,date_started)) /365.25 len_of_service_in_yrs
from employee
where empltype_code = 'EMPL'
order by len_of_service_in_yrs desc;;
output to c:\lengthOfServiceData.xls format excel;;



Article Details
Article ID: 46
Created On: 24 Jun 2009 03:57 PM

 This answer was helpful  This answer was not helpful

 Back
 Login [Lost Password] 
Email:
Password:
Remember Me:
 
 Search
 Article Options
Home | Register | Submit a Ticket | Knowledgebase | Troubleshooter | News | Downloads
Language:

Help Desk Software By Kayako SupportSuite v3.50.05