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

Need to ignore all null parameters in a record selection formula

Status
Not open for further replies.

thebobman

Programmer
Sep 25, 2000
12
US
I am using Crystal Reports 8.5 to access an oracle database.

In my record selection formula I need to ignore all null parameters. How do I do this?

The BOBMAN
 
A common means is to set a default value, such as with text to "All".

So the record selection formula might look like:

(
If {?MyParm} <> &quot;All&quot; then
{table.field1} = {?MyParm}
else If {?MyParm} = &quot;All&quot; then
true
)

With dates or numerics, pick a value that is outside the scope of entered values, and in the prompting text describe that leaving the parameter to the default will ignore this parameter.

Note that the further qualification of Else IF provides for properly passing SQL to the database:

Also make sure that you use the CR supplied ODBC driver rather than the Oracle ODBC driver when using ODBC.

Here's a FAQ on this:

faq767-3825

-k
 
Alternatively, you could do
if not isnull (?YourParam) then

Madawc Williams
East Anglia, Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top