Subject Re: [firebird-support] NULL Date values
Author Martijn Tonies
Hi,

> I have experience with non-SQL databases. I am currently working on
> a web application and have run into a problem that happens when the
> user does not supply a date and NULL is stored to FB.
>
> Last night, I installed rFunc and used DateToStr which properly
> converts the date value to a string format, but if the date value is
> NULL, the string value returned is 11.17.4294967254!
>
> I don't know what that value is supposed to mean and I am surprised
> that the DateToStr function does not test for NULL and return an
> empty string whenever a NULL date is recieved.
>
> This leads me to believe that maybe I should be storing an empty
> value into a date field when the date is unknown. Is there a way to
> store an 'empty' date value in FB2 instead of NULL?

NULL is "empty", it doesn't get more empty than that.

The function from the library should be fixed.

Perhaps you could use a COALESCE(MyColumn, DateToStr(MyColumn), '')
to work around the display problem?

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com