×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Parameter / Record Selection option to include or exclude NULL values

Parameter / Record Selection option to include or exclude NULL values

Parameter / Record Selection option to include or exclude NULL values

(OP)
Using Crystal Reports XI. I've got a field in our Inventory database called PartCategory and that field has 4 possible values: Y, W, U or NULL.

I'm trying to add a parameter to allow users to select which category(s) they want to include on the report. I've tried adding a static parameter but I can't leave the value as NULL...it doesn't like that. So I decided to do two parameters...one category "Include Categories" for the user to select which categories (Y, W or U) to include and a second parameter "NULL Categories" to either include or exclude NULL categories. Just need some direction on how to setup my record selection to make this happen.

My current record selection is:

{Inventory.Yard} = {?Yard} and
{Inventory.Stock} = {?Stock Numbers} and
{Inventory.PartCategory} = {?Include Categories}

Any help would be greatly appreciated.

Thanks!

RE: Parameter / Record Selection option to include or exclude NULL values

First off, what version of Crystal Reports are you running? Because a few versions ago, you can have optional parameters (thus allowing null values). Then there is a function called HasValue(). It checks a parameter to see if anything was entered.

RE: Parameter / Record Selection option to include or exclude NULL values

(OP)
Crystal Reports XI...it was in my original post.

RE: Parameter / Record Selection option to include or exclude NULL values

I think this may help.

For your Categories in the parameter, use the word 'Null'.
Then in your select/formulas if the word 'Null' is selected perform the null check.
Something similar to below but with your actual criteria/database

Create a parameter
--{?Param} values = Yard, Stock, Upper Shelf, None

Edit the record selection formula
--Select Formula =
IF {?Param} = "Yard" then
{Inventory.PartCategory} = "Y"
and {whatever other items needed here}
ELSE
IF {?Param} = "Stock" then
{Inventory.PartCategory} = "S"
and {whatever other items needed here}
ELSE
IF {?Param} = "Upper Shelf" then
{Inventory.PartCategory} = "U"
and {whatever other items needed here}
Else
IF {?Param} = "Null" then
(TRIM({Inventory.PartCategory}) = ""
OR
IsNull({Inventory.PartCategory})=TRUE)
and {whatever other items needed here}

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close