[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.birt] Re: Value '0000-00-00' can not be represented as java.sql.Date

Use an IF statement within your SQL to evauluate if(`MyDate` = '0000-00-00',
then NULL, otherwise `MyDate`). Your IF statement will return a string value
of either the date or null.

JDBC does not understand that 0000-00-00 is MySQL's NULL notation.

"Mr. Burns" <Mr._Burns@xxxxxx> wrote in message
news:e1lam7$fmr$1@xxxxxxxxxxxxxxxxxxxx
> Hello,
>
> I use JVM 1.5.0_04, BIRT 2.0.0 and MySQL 4.1.13.
>
> I have a simple MySQL table called R1 with just one column 'MyDate' of
type
> Date.
> There is only one record within this table with following date value:
> 0000-00-00
>
> In BIRT it is not possible to create a dataset with the query: SELECT *
FROM
> R1
> If  I create ths query inside the querybuilder of BIRT and if I click
> 'result preview' I get following exception:
>
> Value '0000-00-00' can not be represented as java.sql.Date
>
> With date values like 2004-04-13 it works fine.
> So what if I have the date default value 0000-00-00 in my database?
> Is there any solution or workarround available to solve this problem?
>
> Thanks for any help!
>
>