Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BOOLEAN IF THEN STATEMENT

Status
Not open for further replies.

codingsupv

Technical User
Nov 24, 2009
1
US
I am trying to write an If/Then statement in Business Objects report writer and am coming up with a Boolean variable error. This is what I was trying:

= If (<Procedure Code>="G9142") Then "90663"
The error I am receiving is:
Bad Variable type
You must create a Boolean variable

If I were doing this in Access, it would look like this:

Iif([Procedure Code]="G9142","90663")

I am a real novice at this, so any help would be greatly appreciated! Basically what I am trying to do is replace the code G9142 in the procedure code column with code 90663.
 
Hi,

First of all, you don't need the = sign in front of IF. Second, the format of your 'Procedure Code' looks odd in Crystal. Fields usually look like {table.field} Is this actually how it appears in your report?

 
Oh, forgot one more thing: You don't need the parentheses around the field name. And what should display if the field value is not = G9142?

Code:
if {table.field} = 'G9142' then '90663' Else 'some other value'
 
If you are using Crystal Reports, then I'm guessing you are creating this formula in the wrong area. You should go into the field explorer->formula->new and create the formula there and then drag it onto the report.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top