You are viewing an old version of this page. View the current version.
Compare with Current
View Version History
Version 1
Next »
Description
This SQL selection finds all the people that are missing Department references in the booking request. It picks up the Department from the person's activity linked to that booking.
Selection
Crew members missing Department references in the booking request
SQL statement
SQL statement
select arr.PIN,
arr.BOOKING_STATUS,
arr.travelRequestID,
org.NAME as 'Department Name'
from PWCCMCHANGECREWLIST CR
left join PW001P03 P03 on p03.SEQUENCENO=cr.nextact or p03.SEQUENCENO=cr.CURRENTACT and p03.PIN=cr.pin
right join PWCCMFLIGHTARRANGEMENTS arr on arr.SEQNOM=CR.SEQNO and arr.PIN=cr.PIN
left join PWORG org on org.NUMORGID=dbo.ad_scanorgtree(p03.NuMORGID, 4)
order by PIN
Field Specification