-
Вопрос (16.04.08 22:29) [0]
-
SELECT K.Klient, K.Kod, COUNT(DOC.Num) AS QUANT_DOC, SUM(TVR."Кол-во" * TVR."Цена") AS SUM_ORD, SUM(TVR."Кол-во") AS QUANT
FROM "Клинты" K, "Шапка накладной" DOC, "Товары накладной" TVR
WHERE ((DOC.Klient+0) = K.Klient)
AND (DOC.Data >= '01.01.2002 00:00:00')
AND (DOC.Data <= '01.12.2002 23:59:59')
AND ((TVR.Num+0) = DOC.Num)
GROUP BY K.Klient, K.Kod