Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SQLSkript V2.0
- --History
- --18.10.2024 Georgi Horozov
- stat:Name=Gopet_ClientsAndAddresses
- stat:HelpContext_Dlg=01012267632132312024
- stat:Modules=carlo
- stat:CheckSum=E7BF7721421162024
- ALLROWS
- IN:var_LoadingDateActual:timespace:Actual loading DATE
- OUT:Truck NUMBER:Truck NUMBER:atour.LKWKZ::COUNT:1
- OUT:Trailer NUMBER:Trailer NUMBER:atour.ANHAENGERKZ::COUNT:2
- OUT:GOPET LOGISTICS EOOD AS Sender:GOPET LOGISTICS EOOD AS Sender:SK.NAME1::COUNT:3
- OUT:Loading DATE WHEN Sender IS GOPET LOGISTICS EOOD:Loading DATE WHEN Sender IS GOPET LOGISTICS EOOD:CASE WHEN SK.KUNDENNR = 23164813 THEN LADEDATUMSTARTIST END::COUNT:4
- OUT:GOPET LOGISTICS EOOD AS Receiver:GOPET LOGISTICS EOOD AS Receiver:SKU.NAME1::COUNT:5
- OUT:Unloading DATE WHEN Receiver IS GOPET LOGISTICS EOOD:Unloading DATE WHEN Receiver IS GOPET LOGISTICS EOOD:CASE WHEN SKU.KUNDENNR = 23164813 THEN LIEFERDATUMENDEIST END::COUNT:6
- OUT:Carrier name:Carrier name:S.NAME1::COUNT:7
- OUT:Tour NUMBER:Tour NUMBER:ATOUR.TOURNUMMER::COUNT:8
- *SELECT*
- FROM ATOUR
- JOIN ATASEND ON ATOUR.NR = ATASEND.TOURNR
- JOIN ASENDUNG ON ASENDUNG.SENDUNGID = ATASEND.ASENDUNGID
- JOIN SKUNDEN S ON S.NR = ATOUR.UNTERNEHMER
- JOIN SKUNDEN SK ON SK.NR = ASENDUNG.ABSNR
- JOIN SKUNDEN SKU ON SKU.NR = ASENDUNG.EMPFNR
- WHERE LADEDATUMENDEIST >= :var_LoadingDateActual
- AND LADEDATUMENDEIST <= :var_LoadingDateActual
- AND (SK.KUNDENNR = 23164813 OR SKU.KUNDENNR = 23164813);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement