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

Crystal Reports Newbie, Arg how do I make an OR statement

Status
Not open for further replies.

Zugdud

IS-IT--Management
Feb 26, 2003
158
US
Im trying to make a forumla that will check two fields for no values (NULL) values. If both fields are NULL return value 'yes' for variable reg, else if a value is not null return a value of 'no' for variable reg. Am I on the right track here?

if{OrderHed.Character01} or {OrderDtl.Character01} <> NULL then booleanVar reg:= 'yes' else booleanVar reg:= 'no';

THANKS
 
Check for NULL's first.
Code:
booleanVar  reg;

if isnull({OrderHed.Character01}) then
   reg := no  //or false instead of no
else
   reg := yes  //or true instead of yes
You can use yes or no to set the boolean variable but if you display this formula it will display True or False. You can rectify that by formatting the field on the report and change the Boolean Text under the Boolean tab.

Also, if you are not using the reg variable in another formula, you don't need to use the variable at all, just return yes or no. I also like to declare any variables once at the beginning of the formula and then just reference them later.

~Brian
 
Booleanvar reg;
if isnull({OrderHed.Character01})
and isnull({OrderDtl.Character01}) then
reg:= false
else
reg:= true;
reg
 
Thanks for the help guys, much appricated! I was able to get the report to working with your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top