Subject Re: [firebird-support] division by zero
Author Peter Lee
Hi Jaimy,

Thanks for this - didn't realise you could use case on an aggregated field...

All working fine now!

Regards,

Peter Lee

At 18/03/2004, you wrote:
>On Thursday, March 18, 2004 3:26 PM Peter Lee wrote:
>
> >
> > We are getting 'Arithmatic overflow or division by zero has
> > occurred. arithmetic exception, numeric overflow or string truncation'
> > from the following query (running it through IBExpert, FB1.5).
> >
>
>You can use SELECT... CASE statement to evaluate
>sum(g_stats.prac_attempted), eg:
>
>SELECT ....,
> CASE
> WHEN (SUM(g_stats.prac_attempted) IS NULL) then 0
> WHEN (SUM(g_stats.prac_attempted) = 0) then 0
> ELSE SUM(g_stats.prac_correct) * 100 / SUM(g_stats.prac_attempted)
> END
>FROM ....
>
>Salam,
>
>-Jaimy
>
>
>
>
>Yahoo! Groups Links
>
>
>
>

-
Peter Lee Mobile: +61 412 011 174 ptle@...
-----------------------------------------------------------------------
Rising Software Australia Pty. Ltd. http://www.risingsoftware.com/
Publishers of 'Auralia' - Ear Training and 'Musition' - Theory Training
Ph: +61 3 9481 3320 FAX: +61 3 9481 3380 USA Freecall: 1 888 667 7839