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

NULL Date in CR8.5

Status
Not open for further replies.

sane79

MIS
Nov 18, 2003
60
SG
Hi all..

I have a problem here.
I need to print out reports, whereby one of the date field may be empty.
I need it such that if that date field is null or (30/12/1988) which is the null date by CR, then leave the date field empty in the report...

I tried doing this under the Record selection formula for that date field:

if {table.date} <> CDate(1988,12,30) then
totext({table.date})
else
&quot;&quot;

but it tells me &quot;This field name is not known&quot; with the error pointing to &quot;&quot;

then i tried this method:
if {table.date} <> CDate(1988,12,30) then
{table.date}
else
cdate(0,0,0)
and it does not work also..

Can someone pls advise me... :(
Thanks!
 
It doesn't go in the record selection formula.

Create a formula in lieu of your database field and place the code in there (Insert->Field Object->Right click Foirmula Fields and select New->Name it and place the code in there).

Now use this field instead of the databsae field on the report by dragging it to the same location.

-k
 
Opps.. stupid me.. *boink* :)

Anyway... i created a formula field as u mentioned and tried runing the report...

but it appears that nothing is being shown in there when the report is run... :(
It seems to hide away all fields, whether or not the date in the table is empty..
any idea what went wrong?
 
Try this:

if {table.date} <> CDate(1988,12,30) then
totext({table.date})
else
&quot;Null&quot;

Now place this in the details, and place the real table field alongside. You can now see the data and the formula to test it's accuracy.

-k
 
Hi K!

IT still does not seem to work..
Could it be due to the different date formats stored in MySQL tables and CR?

Anyway.. I tried just comparing the year and everything works fine now!
Thanks!
 
OK, glad to hear it, hopefully that isn't a possibility in your date field.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top