Moin Kollegen,

wer kann mir helfen? Folgende SQL-Anweisung habe ich mir mit Hilfe des QM erstellt.

select A.KUNUM, A.KUABW, A.KUONM, B.ADNM1, C.KOONR,
D.OBJBZ, C.KOBBP, C.KOBBJ, C.KOBEP, C.KOBEJ, C.KOPRS
from LZDTAtst/GKUNSTP A, LZDTAtst/GADRSTP B, LZDTAtst/GKUOBZP C,
LZDTAtst/GOBJSTP D
WHERE (NOT(KUSTS = '9')
AND (KUABW = 0)
AND (((DIGITS(KOBEJ))!!(DIGITS(KOBEP))) = '000000')
AND (KOONR = 1020)
OR NOT(KUSTS = '9')
AND (KUABW >= 200742)
AND (((DIGITS(KOBEJ))!!(DIGITS(KOBEP))) >= (DIGITS(KUABW)))
AND (KOONR = 1020))
AND (KUNUM = ADNUM)
AND (ADNUM = KONUM)
AND (KOONR = OBJNR)
ORDER BY A.KUNUM

Funktioniert wunderbar. Aber ich habe meine Probleme mit der Sysntax. Nach diesem Muster bräuchte ich ein Update. Wenn alle Bedingungen erfüllt sind mach ein Update auf ein Feld Preis. Vielen Dank für Eure Mühe im voraus.