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

Record Selection 2

Status
Not open for further replies.

sim133

Technical User
Sep 14, 2004
85
US
Hi Everyone;
I have a field that has 'on' and null values in the table. I was wondering how I could create the if statement in record selection to select the 'on' values only or the null values or both using a parameter. This is what I tried, it works for on and null values , but not when I select 'all'

Code:
(if {?actStatus} = 'COMP' then
{ACTION_ITEMS.ACTI_COMPLETED} = 'on'
else if {?actStatus} = 'PEND' then
isnull({ACTION_ITEMS.ACTI_COMPLETED})
else if {?actStatus} = 'ALL' then
isnull({ACTION_ITEMS.ACTI_COMPLETED}) or{ACTION_ITEMS.ACTI_COMPLETED} = 'on' )
 
Hi,
Rewrite the code as this:
Code:
(
if {?actStatus} = 'ALL' then
True
else 
 if {?actStatus} = 'COMP' then
   {ACTION_ITEMS.ACTI_COMPLETED} = 'on'
 else 
  if {?actStatus} = 'PEND' then
   isnull({ACTION_ITEMS.ACTI_COMPLETED})
)

The 'True' boolean means return ALL the records..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Check the Database->Show SQL Query, it may not get passed as written, depending upon the software version (please post basic info), I would use:

(
if {?actStatus} <> 'ALL' then
if {?actStatus} = 'COMP' then
{ACTION_ITEMS.ACTI_COMPLETED} = 'on'
else
if {?actStatus} = 'PEND' then
isnull({ACTION_ITEMS.ACTI_COMPLETED})
else if {?actStatus} = 'ALL' then
True
)

You might review my FAQ for similar advanced topics:

faq767-3825

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top