Re: Wieviel, wurde wie oft in welches Land geliefert.
Verfasst: Mi 9. Sep 2020, 19:43
cool
Warenwirtschaftssystem
https://www.cao-faktura.de/forum/
Code: Alles auswählen
SELECT
JOURNAL.RDATUM as 'Re-Datum',
JOURNAL.VRENUM as 'Rech-Nr.',
JOURNAL.ORGNUM as 'ORGNum',
JOURNAL.KUN_PLZ as 'PLZ',
JOURNAL.KUN_ORT as 'Ort',
JOURNAL.KUN_LAND as 'Land',
JOURNAL.GEWICHT as 'GesamtGewicht',
JP.Menge as 'ArtikelAnzahl',
JP.ARTNUM as 'Artikelnummer',
JP.Bezeichnung as 'Bezeichnung',
JP.Gewicht as 'ArtikelStückGewicht',
JP.Artikeltyp as 'ArtikelTyp',
JP.Position as 'Position'
FROM JOURNAL
left outer JOIN JOURNALPOS JP on JP.JOURNAL_ID=JOURNAL.REC_ID
WHERE
JOURNAL.QUELLE_SUB <>2 AND JOURNAL.QUELLE=3
AND JOURNAL.STADIUM between 8 and 9
/* AND KUN_LAND = 'AT' */
AND YEAR(JOURNAL.RDATUM) = :Jahr
AND JP.Position > 0
AND JP.View_Pos <> ''
AND (JP.Artikeltyp = 'S' OR JP.Artikeltyp = 'N')
order by JOURNAL.VRENUM, jp.view_pos