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

Date field / Parameters / Nulls 2

Status
Not open for further replies.

dBjason

Programmer
Mar 25, 2005
355
US
I'm trying to use paramters to filter data on a date field (basically between a start and end date). That part works OK, but I also need it to pull out NULL values as well (which it's not doing). Here's what I have:

Code:
... and

(({s_BondTracking;1.ReleaseDate} >= {?ReleaseDateBegin} 
                               and
{s_BondTracking;1.ReleaseDate} <= {?ReleaseDateEnd}) 
OR
IsNull({s_BondTracking;1.ReleaseDate}) 
OR
{s_BondTracking;1.ReleaseDate} = Date(0,0,0)) 

and ...

Now when I run this, I get ReleaseDates between the before & end dates (good), but I'm not getting records that also have NULL release dates (bad).

Any idea what I'm doing wrong?

Thanks,
Jason
 
Always check for nulls first. Change the formula to:

and
(
IsNull({s_BondTracking;1.ReleaseDate}) or
{s_BondTracking;1.ReleaseDate} = Date(0,0,0)or
(
{s_BondTracking;1.ReleaseDate} >= {?ReleaseDateBegin} and
{s_BondTracking;1.ReleaseDate} <= {?ReleaseDateEnd}
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top