DATE Function is not working properly

View: New views
3 Messages — Rating Filter:   Alert me  

DATE Function is not working properly

by AliasTech :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there,

I just started on Derby. The date funtion does not seem to be functioning correctly. For example,

ij> select col1, date('09/30/2009') from table1;
COL1       |2
----------------------
9          |2009-09-30

as compared to
ij> select col1, date('09/31/2009') from table1;
ERROR 22008: '09/31/2009' is an invalid argument to the date function.

Notice  that 09/30/2009 and 09/31/2009 are valid dates and yet Derby flags 09/31/2009 as an invalid date.

Please advise.

Thanks.

Re: DATE Function is not working properly

by Bernt M. Johnsen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>>>>>>>>>>>> AliasTech wrote (2009-06-10 05:12:25):

>
> Hi there,
>
> I just started on Derby. The date funtion does not seem to be functioning
> correctly. For example,
>
> ij> select col1, date('09/30/2009') from table1;
> COL1       |2
> ----------------------
> 9          |2009-09-30
>
> as compared to
> ij> select col1, date('09/31/2009') from table1;
> ERROR 22008: '09/31/2009' is an invalid argument to the date function.
>
> Notice  that 09/30/2009 and 09/31/2009 are valid dates and yet Derby flags
> 09/31/2009 as an invalid date.
>
> Please advise.
AFAIK there are 30 days in September, and thus the error message is
correct.


>
> Thanks.
> --
> View this message in context: http://www.nabble.com/DATE-Function-is-not-working-properly-tp23960955p23960955.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.
>

--
Bernt Marius Johnsen, Staff Engineer
Database Technology Group, Sun Microsystems, Trondheim, Norway


signature.asc (196 bytes) Download Attachment

Re: DATE Function is not working properly

by AliasTech :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Bernt M. Johnsen wrote:
>>>>>>>>>>>> AliasTech wrote (2009-06-10 05:12:25):
>
> Hi there,
>
> I just started on Derby. The date funtion does not seem to be functioning
> correctly. For example,
>
> ij> select col1, date('09/30/2009') from table1;
> COL1       |2
> ----------------------
> 9          |2009-09-30
>
> as compared to
> ij> select col1, date('09/31/2009') from table1;
> ERROR 22008: '09/31/2009' is an invalid argument to the date function.
>
> Notice  that 09/30/2009 and 09/31/2009 are valid dates and yet Derby flags
> 09/31/2009 as an invalid date.
>
> Please advise.

AFAIK there are 30 days in September, and thus the error message is
correct.


>
> Thanks.
> --
> View this message in context: http://www.nabble.com/DATE-Function-is-not-working-properly-tp23960955p23960955.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.
>

--
Bernt Marius Johnsen, Staff Engineer
Database Technology Group, Sun Microsystems, Trondheim, Norway

 
Hey Bernt,

I'm sorry. It's my stupid mistake. Thanks for your prompt reply. I feel like an idiot.

Regards