troubleshooting Question

Blank Optional DateRange omits Null Date values

Avatar of Hillary B
Hillary B asked on
Crystal Reports
6 Comments1 Solution206 ViewsLast Modified:
This is very close to many other topics but not quite what I'm looking for.

I have an Optional date range param that is set up like this in my record selection.
(not(HasValue({?DateRange}))) OR ( isnull({Table.Date}) or {Table.Date} in {?DateRange} )

When the date range is entered, it runs records within that range as well as NULL dates. This works fine.
However, when the range is left blank, it only runs for non-NULL dates. If the date value is null, it get omitted from the results.

I have tried:
if HasValue({?DateRange}) then
   isnull({Table.Date}) or {Table.Date} in {?DateRange}
else true

As well as:
if HasValue({?DateRange}) then
   isnull({Table.Date}) or {Table.Date} in {?DateRange}
else
     isnull({Table.Date}) or not(isnull({Table.Date}) )


What can I do to get NULL dates when the param is left blank?

Thanks
ASKER CERTIFIED SOLUTION
Hillary B

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros