Subject Re: [IBO] TIB_DATE
Author Helen Borrie
At 11:36 AM 25/09/2006, you wrote:
>Hello:
>
>Is there a way to have the TIB_DATE control display nothing if the
>underlying field contains is empty. The control displays 12/30/1899

Something in your configuration is telling Delphi that an "empty"
date is zero. The date you are seeing is Delphi's "date zero"
date. (IB/Firebird use a different date for "date zero").

So - find out what is forcing your null date to be represented as
zero, e.g. are you using COALESCE() to read this field from the
database? Or somehow setting zero as a default?

Note that, if your database has actually *stored* zero in a date
field, it's probably due to using a bad tool for converting from a
legacy Paradox or Access database, since the engine itself won't
accept zero as input to a date/time type. Ideally, you want to
rectify this by trying to set zero dates to null in a one-off
operation, thus avoiding these peculiarities. Unknown dates should
be stored as null. If you have a non-nullable requirement for a
date/time column, you must default it to an actual date/time value of
the required type, e.g. current_date or 'TODAY' for date types,
current_timestamp or 'NOW' for timestamp, or some expression that can
give you an acceptable default.

Helen