You are viewing an old version of this content. View the current version.
Compare with Current
View Version History
Version 1
Current »
Description
The view is intended to show all crew with passports expiring within the next 6 months. Meaning that the passport Expiry Date <= 6 months in the future.
View Sample

Main Data Selection
All active crew with passport Expiry Date <= 6 months in the future.
SQL statement
Click here to expand...
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 |
---|
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