Time in Company

Summary

The view shows the number of Onboard crew that have worked for the company for a certain number of months or years.

Keywords

company, employment

Category

Analytical View

Description

The view shows the number of Onboard crew that have worked for the company for a certain number of months or years.

View Sample

Main Data Selection

The view checks employed crew that are currently onboard - have current Onboard activity (Code='ONB') and shows the number of crew that have been employed for a certain number of years or months. Employment start date of the crew is checked.

SQL statement

select C02.NAME RANK, P01.PIN, P01.CLIENT NUMORGID, P01.EMPLOYMENTSTARTDATE, P01.EMPLOYMENTENDDATE, p01.NAME, p03.code as ACTIVITY, p03.VESSELNAME, ROUND(DATEDIFF(Day, p01.employmentstartdate, GETDATE())/365,0) as YEAR, ROUND(DATEDIFF(Day, p01.employmentstartdate, GETDATE())/30,25) as MONTH, 1 AS PersonCount from pw001p01 p01 LEFT JOIN PW001P0P P0P ON ((P01.PIN=P0P.PIN) AND (P0P.PNUMBER='A')) LEFT JOIN PW001C02 C02 ON P0P.POSITIONID=C02.CODE LEFT JOIN PW001P03 p03 ON p03.PIN = p01.PIN and p03.planned<> 'Y' where DATEDIFF(MONTH, p01.employmentstartdate, GETDATE()) >=1 and P01.EMPLOYMENTENDDATE is Null and p03.code = 'ONB' AND p03.DATEFROM <= CONVERT(varchar, GETDATE(), 112) AND (p03.DATETO >= CONVERT(varchar, GETDATE(), 112) OR p03.DATETO IS NULL)

Rows/ Columns Specification

View Field

Adonis Field

Comment

View Field

Adonis Field

Comment

Rank

Rank name from Personal Details

 

Name

Crew Name

 

Activity

Current activity name

 

Vesselname

Vessel name from the target actvitiy

 

Year

Number of years the person is employed

 

Month

Number of months the person is employed