cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal reports date parameter to include null values

Former Member
0 Kudos

I have several date fields that I've brought into parameter prompts. All was going well until I discovered that there were some null values in those date fields. When a date range is chosen in the parameter, it excludes records with null values. I then made the date parameter optional and (following the advice from an earlier post) modified my selection to

(If HasValue({?StartDate}) Then

{v_DV_DDC_v1.Start_Date} IN {?StartDate}

Else

True)

This allowed the user to just skip that particular parameter and the report would bring in the records whether or not there was a value in the date field.

Here's my question. Can I make it so that users can put in a date range and the report returns records within that date range as well as any records that have null values in the same date field? For example, the user chooses 07/01/2013 to 07/15/2013 as the date range. The report would then return all the records that were between 07/01/2013 and 07/15/2013, plus the report would bring in the records where there were null values in that same date field.

It seems like I can have either a date range or all records, but I can't have the date range plus null values for the same field. Any help would be great.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Ahren,

You may try this Record Selection Formula instead:

(

Not(Hasvalue({?My Parameter}))

)

OR

(

isnull({Sheet1_.Date}) OR {Sheet1_.Date} IN {?My Parameter}

)

P.S: Make sure the brackets are as they are.

-Abhilash

Former Member
0 Kudos

Abhilash,

That was perfect! Exactly what I was looking for. Thanks!

Ahren

Answers (0)