Subject Re: SP To Compute Sales Report
Author Muthu Annamalai
As Bill said I was trying to create view and solve the problem,
just yahoo page refresh, I got help from Smith.

I tried Smith code and viola, it worked exactly as I want.

Thank you guys and keep up your good work

Regards,

Muthu Annamalai


--- In firebird-support@yahoogroups.com, Alexandre Benson Smith
<iblist@t...> wrote:
> 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