Skip to Content
0
Former Member
Aug 12, 2013 at 05:03 PM

How Would I Do This Record Selection Formula?

25 Views

Hi. I have 3 parameter fields. There is {?Customer No}, {?Location} and {?date range} For customer no and location, I have a default of "all customers" or "all locations". The formula editor is complaining and I'm not sure how to fix it. My record selection formula is

if ( {?Customer Number} <> "All Customers") or

({?Location} <> "All Locations") then

(

if ( {?Customer Number} <> "All Customers") then
{
({Command.CUSTOMERNO} like {?Customer Number}) and
}


if ({?Location} <> "All Locations") then
{
({Command.LOCATION} like {?Location}) and
}

({Command.DATECOMPLETED} = {?Date Range})

)

else

{Command.DATECOMPLETED} = {?Date Range}

The date range is always going to be mandatory. If the string parameter value is <> "all customers" or "all locations", then I need to filter based on that chosen value.

In other words, if {?Customer Number} = "All Customers" and {?location} = 3, I need the formula to be

{command.location} like {?location} and

{command.datecompleted} = {?date range}

Any help, of course, will be appreciated. 😊