When saving an excel spreadsheet to a database file I have some date fields that if they are blank, I would like it to say "Present" in the field. How would this be accomplished? Any ideas would be appreciated.
Yes, I am using an excel spreadsheet and converting it into a database format and then importing it into Crystal Reports. When I set up the spreadsheet I formatted some of the fields as date fields, but when the date is left blank the field was entered into the spreadsheet as Present. On the crystal report the field is blank because it is looking for a date. I tried to add code to say if null then "Present", but the field isn't actually null because the slashes are there / /. I would imagine that if I had originally set up the field as text and then had them enter the date then the present would be there, but now that it is a date field I was wondering if it was possible to handle this on the Crystal side.
Thanks,
Kathy
I don't think a date field can hold slashes when empty. You may not have a true date field as read by Crystal. Right click on a date value in preview and select "Browse Field Data" and see what data type comes up. This will tell us how to write the formula. Ken Hamady
Ken,
When I checked on the field, it is a date field Date(2000,01,01), and it shows up as a blank on the preview in Crystal, but if I look in the database, I see the slashes.
I tried this formula field in place of the date field I had before and the date shows up if there is one, but when there isn't, it doesn't say Present, it is just blank on the preview page.
If {leadership1.3RD_END_DA} < Date (1910,1,1)
then "Present"
else ToText({leadership1.3RD_END_DA})
Thanks,
Kathy
What is the database?
When you browse your data do you see a blank in them sample list?
In your File - Report Options settings, do you have a "Convert Null to Default" set?
Ken Hamady
The database is DBF 4 (dBaseIV)(*.dbf) A database version saved from excel. I see the dates when I browse the data field, and I don't have "Convert Null to Default" set? should I?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.