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

Supressing Null value for Date fields 1

Status
Not open for further replies.

netusepk

IS-IT--Management
Feb 28, 2001
17
0
0
US
Hi,
I am trying to limit records based on NULL values for a data field, as the database(visual foxpro) is displaying as 12/30/1899 as the default date. I created a formula field to check for value of above date(12/30/1899) and blank it in a IF condition, later tried to limit the records to check of ISNULL(formula field) but it doesnt seem to work as its displaying all the records, Is there a way to do this check some other way?
Thanks
Jack
 
Visual FoxPro, in my experience, does not store dates as Nulls, ever. Usually, it stores a blank date as a string of ' / / '. You should try using that in the formula. If you run out of options you could always force crystal to do the suppress by using this syntax...

if isnull(myfield) THEN TRUE
ELSE
IF TOTEXT(
((myfield) like '*/ /*')
OR
((myfield) like ' /*')
OR
((myfield) like '*/ ')
)
THEN TRUE
ELSE
FALSE

This will check if there are blanks in the field, and if any one of the particular spots in the field, then not allow Crystal to guess what to do, True=Suppress, False=Show...
 
What happens if you select records where the date is less than 1/1/1900? This is day "one" and the date you are seeing is day "zero" or the day before day "one". At least that is how CR is interpreting it. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top