Subject Re: [firebird-support] Re: SP To Compute Sales Report
Author Alexandre Benson Smith
Muthu Annamalai wrote:

>Bill,
>
>Thanks for your time.
>
>Yes you are right, RECEIPT.RECEIPTDATE has time also.
>
>I already tried that.
>
>The problem is in group by I am not able to use cast , it is
>throwing "token unknown error"
>
>Regards,
>
>Muthu Annamalai
>
>
Hi,

Try to change your select inside your sp to

FOR SELECT CAST(RECEIPTDATE AS DATE),
COUNT(CAST(RECEIPT.RECEIPTNUMBER AS INTEGER)),
SUM(RECEIPT.AMOUNT),
AVG(RECEIPT.AMOUNT)
FROM RECEIPT
WHERE CAST(RECEIPT.RECEIPTDATE AS DATE)
BETWEEN :FROMDATE AND :FROMDATE + 6
GROUP BY 1
INTO :SALESDAY,:RECEIPTS,:SALES,:AVERAGESALES

if you are using Fb 1.5 of course....

Note that you are grouping by the column index.

see you !

--

Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br