• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1313
  • Last Modified:

How do I fix this error "a boolean array is required here" in Crystal report?

I use Crystal Report 8.5
I just want to add a formular field to the report but the database fields in my formular contain null value. I've tried the convert null to default value in the Report Options. But it doesn't work. It makes my report shows no result at all. So someone suggested me to convert the null field by creating a newformular field of that null field using if then else.
i.e. database field that contain null are A, B, C, D.
I want to make a new report field that get the value of A+B+C-D
what I did was:
@A = if isnull(A) then 0.00 else A = A
and the same for @B, @C, and @D
@WDV = @A + @B + @C - @D  
But then I come across this error "a boolean array is required here" and it show the ( at the @B
How do I get this right?
0
lotusseed
Asked:
lotusseed
  • 3
  • 2
1 Solution
 
mlmccCommented:
A formula can only return a single type.

Can you post the actual formulas you are trying to use?

mlmcc
0
 
lotusseedAuthor Commented:
@add
if isnull({FasMast.additions}) then {FasMast.additions} = 0.00
    else {FasMast.additions} = {FasMast.additions}

@depre
if isnull({FasMast.book_dep_total}) then {FasMast.book_dep_total} = 0.00
 else {FasMast.book_dep_total} = {FasMast.book_dep_total}

@pur
if isnull({FasMast.purch_value}) then {FasMast.purch_value} = 0.00
 else {FasMast.purch_value} = {FasMast.purch_value}

@reval
if isnull({FasMast.reval_adj}) then {FasMast.reval_adj} = 0.00
 else {FasMast.reval_adj} = {FasMast.reval_adj}

@wdv
{@pur}+{@add}+{@reval}-{@depre}
0
 
mlmccCommented:
Try it this way.  All your formulas return true or false not numbers

@add
if isnull({FasMast.additions}) then
    0.00
else
    {FasMast.additions}

@depre
if isnull({FasMast.book_dep_total}) then
    0.00
else
    {FasMast.book_dep_total}

@pur
if isnull({FasMast.purch_value}) then  
    0.00
else
    {FasMast.purch_value}

@reval
if isnull({FasMast.reval_adj}) then
    0.00
else
    {FasMast.reval_adj}

@wdv
{@pur}+{@add}+{@reval}-{@depre}

mlmcc
0
 
lotusseedAuthor Commented:
Thank you so much, it works now.
0
 
lotusseedAuthor Commented:
Thank you very much.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now