Subject Re: [firebird-support] help with subquery in SP
Author Alan.Davies@aldis-systems.co.uk
Pavel, thank you. It works perfectly and I have extended it to work with the
full data set. Thanks for the quick response, too.
Alan
Quoting Pavel Menshchikov <developer@...>:

> Hello Alan,
>
> Try this:
> -----
> CREATE PROCEDURE GET_DELIVERIES_DAY (
> FROMDATE DATE,
> UPTODATE DATE)
> RETURNS (
> DATE_IN DATE,
> TONNES_CONTRACT NUMERIC(9,3),
> TONNES_ASL NUMERIC(9,3))
> AS
> BEGIN
> for select date_in,
> sum(case when contract_code<>11 then tonnes else 0 end),
> sum(case when contract_code=11 then tonnes else 0 end),
> from deliveries
> where date_in>=:FromDate
> and date_in<=:UpToDate
> group by date_in
> into :date_in, :tonnes_contract, :tonnes_asl
> do
> suspend;
> END
> -----
>
>
> --
> Best regards,
> Pavel Menshchikov
> http://www.ls-software.com
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>



--
Alan J Davies
Aldis
Tel: +44 (0)1926 842069
Mob: +44 (0)7885 372793