Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- ATOUR.TOURNUMMER AS "Tour number",
- SHIERARCHIE.BEZEICHNUNG AS "Organisation",
- SKUNDEN.NAME1 AS "Carrier Name",
- SUM(ASDGABRECHNUNG.BETRAG) AS "Amount",
- SUM(ASDGABRECHNUNG.BETRAGSTP) AS "Amount without TAX",
- SUM(ASDGABRECHNUNG.CALCSTATSTEUERBETRAG) AS "TAX Amount",
- SUM(ASDGABRECHNUNG.BETRAG) + SUM(ASDGABRECHNUNG.BETRAGSTP) + SUM(ASDGABRECHNUNG.CALCSTATSTEUERBETRAG) AS "Total Expenses",
- SWAEHRUNG.ISOWAEHRUNGSCODE AS "Currency"
- FROM ATOUR
- LEFT JOIN
- SHIERARCHIE ON SHIERARCHIE.ID = ATOUR.HIERARCHIE
- LEFT JOIN
- SKUNDEN ON SKUNDEN.NR = ATOUR.UNTERNEHMER
- LEFT JOIN
- ATASEND ON ATASEND.TOURNR = ATOUR.NR
- LEFT JOIN
- ASDGABRECHNUNG ON ASDGABRECHNUNG.ATAID = ATASEND.NR
- LEFT JOIN
- SWAEHRUNG ON SWAEHRUNG.ID = ASDGABRECHNUNG.WAEHRUNGID
- WHERE
- ATOUR.TOURNUMMER IN (288371, 307961, 286635)
- GROUP BY
- ATOUR.TOURNUMMER,
- SHIERARCHIE.BEZEICHNUNG,
- SKUNDEN.NAME1,
- SWAEHRUNG.ISOWAEHRUNGSCODE;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement