Subject | Group By in For Select |
---|---|
Author | Muthu Annamalai |
Post date | 2006-07-13T16:30:16Z |
I have this following Stored Procedure and I need to group by a
column but I am getting Invalid expression in Select List error
FOR SELECT RECEIPTDATE, RECEIPTDETAILS.ID, ITEMSTYLEID,
SUM(RECEIPTDETAILS.QUANTITY * RECEIPTDETAILS.PRICE)
FROM RECEIPT, RECEIPTDETAILS
WHERE RECEIPT.ID = RECEIPTDETAILS.RECEIPTID AND
RECEIPT.RECEIPTDATE BETWEEN :FROMDATE AND :TODATE
GROUP BY 3
INTO SALESDATE, RECEIPTDETAILSID, ITEMSTYLEID, SALES
DO
BEGIN
/* Code removed for simplicity */
SUSPEND;
END
Any help is highly appreciated
Thanks
Muthu Annamalai
column but I am getting Invalid expression in Select List error
FOR SELECT RECEIPTDATE, RECEIPTDETAILS.ID, ITEMSTYLEID,
SUM(RECEIPTDETAILS.QUANTITY * RECEIPTDETAILS.PRICE)
FROM RECEIPT, RECEIPTDETAILS
WHERE RECEIPT.ID = RECEIPTDETAILS.RECEIPTID AND
RECEIPT.RECEIPTDATE BETWEEN :FROMDATE AND :TODATE
GROUP BY 3
INTO SALESDATE, RECEIPTDETAILSID, ITEMSTYLEID, SALES
DO
BEGIN
/* Code removed for simplicity */
SUSPEND;
END
Any help is highly appreciated
Thanks
Muthu Annamalai