help me error correction. [message #496335] |
Sat, 26 February 2011 22:30  |
helloworld_28
Messages: 60 Registered: October 2010
|
Member |
|
|
hi,
iam new reports,i pratice report , while doing formula colum i used this function it shows error.
function CF_1Formula return Number as
a number;
begin
a :=:sal+:comm;
if a=null then
return (o);
else
return (a);
end
REP-737: Should be a function with return type '<returntype>'.
please help in correction
|
|
|
|
Re: help me error correction. [message #496346 is a reply to message #496338] |
Sun, 27 February 2011 03:16  |
 |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
The error comes from the fact that nothing is EQUAL to NULL. In other words, instead ofyou should have used
As "sal + comm" was NULL, function didn't return any value which caused an error.
Another (shorter) way might be this:
function CF_1Formula return Number as
begin
return case when :sal + :comm is null then 0
else :sal + :comm
end;
end;
[Updated on: Sun, 27 February 2011 03:17] Report message to a moderator
|
|
|