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!

Do not print out NULL date

Status
Not open for further replies.

sane79

MIS
Nov 18, 2003
60
SG
How do I prevent the printing of the Date field in CR8.5 if the value in the database is null?

Currently what I get for a null field is 30/12/1988....

I do not what that field to appear at all...

 
Try:

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

-k
 
LBass offered an option in another post too:

if {table.date} <> CDate(1988,12,30) then
{table.date}
else
cdate(0,0,0)

-k
 
Hi all.. thanks.. Do i put this code under the Select expert in CR or..?
 
That depends on what it is you want to do.

If the intent is to elimate all of the rows where there is an empty date (not what you originally asked for), then you might use the following in the record selection formula:

{table.date} <> CDate(1988,12,30)

If you want to show thee data for those rows, but don't want the oddball dates that are being returned by the database, create a formula to use as the date in lieu of the date field containing one of the above formulas.

-k
 
Hi K.

I tried putting ur code into the record selection of the date field in my report..
BUt I get an error: &quot;This field name is not known&quot; with the cursor at &quot;&quot;.
Can u pls pt to me where i went wrong?
Sorry for asking some stupid questions.. cuz I'm actually quite new to CR.. thanks.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top