I am a bit new to crystal reports even though开发者_JAVA技巧 I've been doing a bit of heavy lifting with it. I have this crystal report that has a datetime field. This field has a default datetime of 1753-01-01 00:00. Now I want this field to display only date like "01-03-2011" and also anywhere it sees the default date, it should display an empty string like ''. To achieve this I used this formular (in the display string)
if CurrentFieldValue = DateValue('1753-01-01 00:00:00') then
''
else
totext(CurrentFieldValue)
This successfully changes the default date to empty string. But now I can no longer change the format to dates only.
I found my own workaround.
In case there is anyone who might be interested in the method I used, here it is
if CurrentFieldValue = DateValue('1753-01-01 00:00:00') then
''
else
totext(CurrentFieldValue, 0)
Can you imagine, just a little 0 after the currentFieldValue!
Here's another approach which will let you do the date formatting at the field level instead of the formula level:
if CurrentFieldValue <> DateValue('1753-01-01 00:00:00') then
CurrentFieldValue
精彩评论