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

Help needed on IF STATEMENT Syntax (Record Selection Formula)

Status
Not open for further replies.
Oct 23, 2007
24
US
Goal: trying to write a IF STATEMENT in the Record Selection Formula area to add extra conditions to filter data I am retrieving.

If a Note creator is selected from the parameter list, then filter Notes by the selected Note creator, else return Notes entered by everyone.

My code:
(IF NOT ISNULL({?selected_notecreator}) THEN
table.notecreatorfield = {?selected_notecreator}
ELSE
' ')

I am having trouble getting the right syntax for the second part of my statement. I want something like:

ELSE return ALL

Please help me get the right syntax. Thanks!
 
Try it this way:

(
if not isnull({?selected_notecreator}) then
{table.notecreatorfield} = {?selected_notecreator}
else if isnull({?selected_notecreator}) then
true
)

~Brian
 
If you are using CR XI, I don't believe you can have a null parameter selection. Assuming the parm is a string, you could instead set up a default of "All" and then use a formula like this:

(
if {?selected_notecreator} <> "All" THEN
{table.notecreatorfield} = {?selected_notecreator} else
if {?selected_notecreator} = "All" THEN
true
)

-LB

 
This is what I end up writing:

(IF ISNULL({?selected_notecreator}) OR {?selected_notecreator} = '' THEN
TRUE
ELSE
{table.notecreatorfield} = {?selected_notetype})

It did work this way. Thanks guys!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top