Subject | Re: [firebird-support] division by zero |
---|---|
Author | Jaimy Azle |
Post date | 2004-03-18T09:23:19Z |
On Thursday, March 18, 2004 3:26 PM Peter Lee wrote:
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
>You can use SELECT... CASE statement to evaluate
> 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).
>
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