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

How write record selection when have two or more parameters? 1

Status
Not open for further replies.

stephcrystaluser

Technical User
Aug 9, 2005
3
US
Hi All,

I have created 2 parameters and appended ".All" to each list. If user wants to select All for the 1st param and an actual value for the 2nd, I need to handle that. I need to handle all scenarios. It seems, I would have to write 4 if statements just to handle all scenarios for these 2 parameters. Is that true? That seems crazy!

Here is the code I wrote:

//Return all data
if {?ApplicationNamesLOV} = '.All' and {?ConflictNamesLOV} = '.All' then
true;

//only filter on conflict name since user selected it
if {?ApplicationNamesLOV} = '.All' and {?ConflictNamesLOV} <> '.All' then
{Conflicts_BE.Conflict Name} = {?ConflictNamesLOV};

//only filter on application name since user selected it
if {?ApplicationNamesLOV} <> '.All' and {?ConflictNamesLOV} = '.All' then
{Conflicts_BE.Application Name} = {?ApplicationNamesLOV};

// filter on both since user selected them
if {?ApplicationNamesLOV} <> '.All' and {?ConflictNamesLOV} <> '.All' then
{Conflicts_BE.Application Name} = {?ApplicationNamesLOV} and
{Conflicts_BE.Conflict Name} = {?ConflictNamesLOV};


Thanks in Advance!
 
Try:

(
if {?ApplicationNamesLOV} <> '.All' then
{Conflicts_BE.Application Name} = {?ApplicationNamesLOV} else
if {?ApplicationNamesLOV} = '.All' then
true
) and
(
if {?ConflictNamesLOV} <> '.All' then
{Conflicts_BE.Conflict Name} = {?ConflictNamesLOV} else
if {?ConflictNamesLOV} = '.All' then
true
)

-LB
 
Both these replies were REALLY helpful! Thank you so much for your quick responses!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top