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

How to add a "NULL" option to a dynamic parameter

Status
Not open for further replies.

jeffm777

IS-IT--Management
Nov 10, 2009
108
0
0
US
I have a parameter where I need to include a NULL option into the dynamic parameter. The field that includes the NULL values is a string. For example, I want the Available Values option of the parameter to show...

NULL
Andy
Jeff
Bill
Carl
Eddie
 
Create a command that is referenced only to create the dynamic parameter picklist:

select table.name
from table
union
select null
from table

Do not link the command to any tables (ignore the warning) and do not reference the command in the body of the report.

-LB
 
Ok. Thanks for the reply but need some help as I'm not too savy with Commands. Here's what I've done thus far...

I created the command and it compiled and I ignored the link warnings. I have the command in my list of database fields and I have created a dynamic parameter pulling in the field from the command. Now what?
 
Actually, let me change that a bit:

The command should read:

select table.name
from table
union
select 'null'
from table

Click on the create parameter column once you have selected the command.field to populate the picklist. Then, in report->selection formula->record, add:

(
(
(
{?Parameter}="Null" and
isnull({table.name})
) or
{table.name} = {?Parameter}
) or
(
{?Parameter}<>"Null" and
{table.name}={?Parameter}
)
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top