Subject | Re: NULL Date values |
---|---|
Author | Adam |
Post date | 2007-09-12T01:36:09Z |
> Hi Ann,What is the confusion?
>
> Zero is the base date, 17 Nov. 1858? The Interbase 6 Data Definition
> doc states that valid dates are from Jan. 1, 100 AD to Feb. 29, 32768
> AD.
>
> Then I read the IB6 Embedded SQL doc and it says that the base 0 date
> is Nov. 17, 1858.
Nov 17 1858 is day 0.
Nov 16 1858 is day -1
Nov 15 1858 is day -2
etc.
The data definition simply tells you not to try and use dates outside
that range.
As Ann (and others have advised), if the *null flag* is set on a
field, the *value* stored in that field is not relevant. An
implementation artifact causes the *value* to be set to 0 when the
field is null.
Zero and null are 2 different things. If you don't understand that,
you should read the Firebird Null Guide on this page:
http://www.firebirdsql.org/index.php?op=doc
Older versions of Firebird were not able to pass a null to a UDF, so
it is understandable that such UDFs would use the value stored in the
field ignoring the null flag. Firebird 2 supports null signals to UDF
calls. (See chapter 13 of release notes).
So if you want your UDFs to handle NULL properly, you will need to be
using Firebird 2, using a version of the UDF that understands the new
convention (check with UDF vendor), and have the UDF declared in your
database to correct way (check with UDF vendor).
Adam