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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conecting Strings

Status
Not open for further replies.

FrankInBerlin

IS-IT--Management
Mar 6, 2002
28
US
Hi everybody!

I have a table with 7 colums resembeling conditions, the fields containing either NULL or 0 meaning the condition is False or 1 meaning the condition is True.
What I want to do is create a formula returning a string with all true conditions (not just the 0's and 1's)

I tried (using basic syntax and only 2 Conditons):

dim x1 as string
dim x2 as string
If "Table"."condition1" = 1 then x1 = "Condition1"
If "Table"."condition2" = 1 then x2 = "Condition2"
Formula = x1+x2

It works fine with only one IF statment, but as soon as I try more conditons I get a blank result!

Can anybody help?

Regards,
Frank
 
You need to test for null in each of the if statements. Otherwise if any of the conditions is null, formula returns null.
I'm not sure about using Basic Syntax, but in Crystal it's:
if (not (isnull({Condition1})) and {Condition1} <> &quot;0&quot;) then &quot;Condition1&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top