Subject | Re: [firebird-support] newbie question |
---|---|
Author | Frank Schlottmann-Goedde |
Post date | 2004-11-17T12:42:12Z |
Gert Coetzee wrote:
when (TempCashup.ORIGINAL = '1') then TempCashup.Amount
else 0
end
)
AS InvAmt,
when (TempCashup.Original ='1') then (cast TempCashup.IDate as
char(10))
else 'xxxxxxx'
end
)
AS Date1
Frank
--
"Fascinating creatures, phoenixes, they can carry immensely heavy loads,
their tears have healing powers and they make highly faithful pets."
- J.K. Rowling
> How would I do this in Firebird ?You may try sth. like this:
> SELECT TempCashup.MatchingRef AS Ref,case
> Sum(
when (TempCashup.ORIGINAL = '1') then TempCashup.Amount
else 0
end
)
AS InvAmt,
> Sum(TempCashup.Amount) AS Outstanding,case
> Min(
when (TempCashup.Original ='1') then (cast TempCashup.IDate as
char(10))
else 'xxxxxxx'
end
)
AS Date1
> FROM TempCashupit's untested.
> GROUP BY TempCashup.MatchingRef, TempCashup.DC, TempCashup.Account
> HAVING (((Sum(TempCashup.Amount)) >= 0.01) AND ((TempCashup.DC) = 'D')
> AND
> ((TempCashup.Account)= 'PIT' ))
> ORDER BY TempCashup.MatchingRef;
Frank
--
"Fascinating creatures, phoenixes, they can carry immensely heavy loads,
their tears have healing powers and they make highly faithful pets."
- J.K. Rowling