/
All: Passport expiring in the nearest 6 months

All: Passport expiring in the nearest 6 months

Summary

The view is intended to show all crew with passports expiring within the next 6 months.

Keywords

Passport, Expire

Category

Crew List View

Description

The view is intended to show all crew with passports expiring within the next 6 months.

View Sample

image-20241206-065931.png

Main Data Selection

All active crew with passport Expiry Date <= 6 months in the future.

SQL statement

CREATE VIEW dbo.PW001SRV25 AS SELECT p01.PIN AS "PIN", p01.NAME AS "NAME", c23.VISATYPE AS "DOCUMENT NAME", CONVERT(VARCHAR(11), p08.dateto, 106) AS "ExpiryDate", p01.Client AS NUMORGID, p01.EMPLOYMENTSTARTDATE, p01.EMPLOYMENTENDDATE FROM pw001p08 p08 LEFT JOIN PW001P01 p01 ON p08.pin = p01.pin JOIN PW001C23 c23 ON c23.CODE = p08.CODE WHERE c23.CODE IN ('PP', 'PP2') AND p08.dateto BETWEEN GETDATE() AND DATEADD(MONTH, 6, GETDATE())

Columns Specification

Column

Description/ Location in APM

Column

Description/ Location in APM

PIN

Crew PIN number.

NAME

Crew full name.

DOCUMENT NAME

Type of the subject document (Passport)

EXPIRYDATE

Expiry date of the document.

Start Page

N/A