On 02/25/2011 09:30 AM, akp geek wrote:
> Hi all -
>
> I have recently upgraded from 8.3 to 9.0.2.
>
> when I run the following sql in 9.0.2 " select to_timestamp('02/26/2011 14:50', 'MM/DD/YYYY HH24MI') " I am
gettingthe following
> error and the sql runs fine in older version
>
> Is it my installation issue or library missing?
>
>
> ERROR: invalid value ":5" for "MI"
> DETAIL: Value must be an integer.
>
> ********** Error **********
>
> ERROR: invalid value ":5" for "MI"
> SQL state: 22007
> Detail: Value must be an integer.
>
>
>
> Thanks for the help
> Regards
military time doesn't have the ':' in the HHMM.
look closely at your 'working' result, does it look like this?
reporting=# select to_timestamp('02/26/2011 14:50', 'MM/DD/YYYY HH24MI');
to_timestamp
------------------------
2011-02-26 14:00:00-05
(1 row)
reporting=# select to_timestamp('02/26/2011 1450', 'MM/DD/YYYY HH24MI');
to_timestamp
------------------------
2011-02-26 14:50:00-05
(1 row)
Note the invalid time for the first result.