I have a Zsql query that returns a date field as part of the result. If the result contains a row where that field has not yet been filled in, I get the following error: Error Type: ValueError Error Value: Invalid value, 0000-00-00, for DATE_START in record 6 How can I work around this?
Jeff> Error Type: ValueError Jeff> Error Value: Invalid value, 0000-00-00, for DATE_START in record 6 Jeff> How can I work around this? If you can modify the database schema, try adding a "default" attribute to the DATE_START field so it has a legitimate default value which is still out of the range for your possible data values. For example: create table foo ( ... DATE_START date default '1953-11-25', ... ); (ALTER TABLE syntax is similar, thought the precise incantation escapes my neuron's grasp at the moment.) -- Skip Montanaro - skip@pobox.com http://www.mojam.com/ http://www.musi-cal.com/
Jeff Sacksteder wrote:
I have a Zsql query that returns a date field as part of the result. If the result contains a row where that field has not yet been filled in, I get the following error:
Error Type: ValueError Error Value: Invalid value, 0000-00-00, for DATE_START in record 6
The traceback for that would be pretty handy. View the source of the error page or, if you're using Zope 2.6, go retrieve it from the very cool error_log object in the root :-) cheers, Chris
participants (3)
-
Chris Withers -
Jeff Sacksteder -
Skip Montanaro