Author |
Message
|
premji |
Posted: Fri Aug 28, 2015 8:39 am Post subject: Date casting issue |
|
|
Acolyte
Joined: 01 Jul 2013 Posts: 64
|
Hi All,
I am facing date format issue, can any one please advise me how can I format these dates. I getting parsing error for this below example.
CAST( '08:11:2014 22:12:02 EST' AS DATE FORMAT 'YYYY-MM-DDTHH:MM:SS'); |
|
Back to top |
|
 |
Vitor |
Posted: Fri Aug 28, 2015 8:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
That's because the format clause doesn't even slightly match the string. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Aug 28, 2015 8:46 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I'm sure the parsing error would be helpful.
I'm sure a small bit of manually matching your value to your pattern would also be helpful. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Aug 28, 2015 8:58 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Vitor wrote: |
That's because the format clause doesn't even slightly match the string. |
And there is a whole section in the Info Centre dedicated to all the different Cast formats that are relevane to DATE, TIME and TIMESTAMP Variable types along with examples. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Aug 28, 2015 9:31 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
smdavies99 wrote: |
Vitor wrote: |
That's because the format clause doesn't even slightly match the string. |
And there is a whole section in the Info Centre dedicated to all the different Cast formats that are relevane to DATE, TIME and TIMESTAMP Variable types along with examples. |
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|