digimortal
Programmer
Hi all,
I can not run this Query
COLORTABLE holds the colors used in a product in different records so I count them to get the number of colors used for an item.
This is what I'm trying to do:
We sold 100kg of items we use 2 color for
We sold 233kg of items we use 7 color for
etc...
I hope someone helps 'cause I'm in big trouble here...
I can not run this Query
Code:
SELECT SUM(I.QUANTITY), (SELECT DISTINCT COUNT(COLOR) FROM COLORTABLE WHERE I.MATERIAL = MATERIAL GROUP BY MATERIAL, REVISION) as COL
FROM SOLDITEMS I, COLOR C WHERE I.QUNIT = 'KG' AND I.CREATEDAT > '01.06.2005' AND I.CREATEDAT < '30.06.2005'
GROUP BY COL
COLORTABLE holds the colors used in a product in different records so I count them to get the number of colors used for an item.
This is what I'm trying to do:
We sold 100kg of items we use 2 color for
We sold 233kg of items we use 7 color for
etc...
I hope someone helps 'cause I'm in big trouble here...