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

Optional Parameters?

Status
Not open for further replies.

adrianroy

Programmer
Sep 25, 2002
4
AU
Hello
I'm using CR9 but this probably won't make much difference.
I have a number of parameters but all are meant to be optional. That is, the user can choose to fill in 1 value for a parameter or not. Therefore some of the parameters will end up as Null values. Obviously I want to ignore these Null value parameters while ensuring the filled-in parameters affect my report.
How can I do this?
Thanks
Adrian
 
A parameter can NEVER be null.

So you can check for it's value with something like:

if {?MyParm1} <> &quot;&quot; then
<do what you need to do>

If you're basing a record selection criteria on it, use something like:

(
If {?MyParm1} <> &quot;&quot; then
{MyTable.MyString} = {?MyParm1}
else
If {?MyParm1} = &quot;&quot; then
true
)

This is purposely checking for both conditions because it increases the likelihood of providing pass through SQL.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top