null value in DECODE gives wrong values count in Crystal
Posted on 2006-05-20
I create view in Oracle and here is short part of it:
MAX(DATA.name) AS Name,
SUM(DECODE(DATA.Type_M1, NULL, 0, 1)) AS Type_M1
FROM DATA ....
I use this view in Crystal 9 for count Type_M1 for each Name.
I got a vert strange problem - if I run my query through database I get Type_M1 = 47
but if check Type_M1 through Crystal it becomes equal = 49.
How can I get right number(47)in Crystal? And why I get wrong number(because when I run the query from Crystal in Oracle it gives me right result again - 47!)
I greatly appreciate any help,
thank you very much