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

Testing for Null dates in version 8 and 9

Status
Not open for further replies.

lawlerpat

Programmer
Jun 28, 2002
54
US
Using the Record selection formula editor I am having difficulty illiminating NULL Dates.
Per Seagates website ( )
They acknowledge this problem. However their solution will only work in either version 8 or version 9 depending on how it is used, but not both at the same time.
The solution is to use the following check
Date({datetimefield}) = Date(0,0,0)
Which fails in version 9 due to an implicit conversion of DateTime fields to Dates. If I use the DateTime(DateField) function then the report fails in version 8.
Any suggestios for how to test for NULL dates that will work in both versions 8 and 9 of Crystal Reports.
FYI: This is for Sql Server and Oracle DBs.
Thanks
 
You might test for a null in the dates using SQL Expressions.

Both 8 and 9 support that.

If you're just trying to eliminate null dates from the recordset, just use Database->Edit selection formula->record:

not(isnull({table.date}))

The rows will never get into the report so there is nothing to check for later.

This will translate to
{table.date} is not null
in the passed SQL to the database.

Check the Database->Show SQL Query

-k
 
Thanks for your advice,
However I am using an ADO recordset passed in from our application. I can not change the recorset on the sql side as it is used for a variety of reports with similar views.

I need to be able to do the edit record selection in crystal on an ADO recorset and let crystal hanlde the removal.

Patrick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top