Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- AKOPF.AUFTRAGSNUMMER AS "Order number",
- SHIERARCHIE.BEZEICHNUNG AS "Order organisation",
- SKUNDEN.NAME1 AS "Customer",
- 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 Income",
- SWAEHRUNG.ISOWAEHRUNGSCODE AS "Currency"
- FROM
- AKOPF
- LEFT JOIN
- SHIERARCHIE ON SHIERARCHIE.ID = AKOPF.HIERARCHIE
- LEFT JOIN
- ASENDUNG ON ASENDUNG.AKOPFNR = AKOPF.NR
- LEFT JOIN
- SKUNDEN ON SKUNDEN.NR = AKOPF.FRACHTAGNR
- LEFT JOIN
- ASDGABRECHNUNG ON ASDGABRECHNUNG.ASENDUNGID = ASENDUNG.SENDUNGID
- LEFT JOIN
- SWAEHRUNG ON SWAEHRUNG.ID = ASDGABRECHNUNG.WAEHRUNGID
- WHERE
- AKOPF.AUFTRAGSNUMMER IN (633168, 633104, 634503)
- GROUP BY
- AKOPF.AUFTRAGSNUMMER,
- SHIERARCHIE.BEZEICHNUNG,
- SKUNDEN.NAME1,
- SWAEHRUNG.ISOWAEHRUNGSCODE;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement