Subject Re: [firebird-support] Query returns invalid result
Author Arno Brinkman
I meant SUM instead of COUNT.

> SELECT
> COUNT(CASE WHEN CPR1.CLAIMSTS = 'P' THEN 1 ELSE 0 END) -
> COUNT(CASE WHEN CPR1.CLAIMSTS = 'X' THEN 1 ELSE 0 END)
> FROM
> CLAIMSPAIDREVERSED CPR1
> WHERE
> CPR1.DATESBM >= ?
> AND CPR1.DATESBM <= ?
> AND CPR1.ACCOUNTID = ?

Regards,
Arno Brinkman
ABVisie