|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Adding Seconds to 20140720T164607 ('yyyyMMdd''T''HHmmss') |
« View previous topic :: View next topic » |
Author |
Message
|
wmb_wps_soa |
Posted: Thu Jul 24, 2014 7:53 am Post subject: Adding Seconds to 20140720T164607 ('yyyyMMdd''T''HHmmss') |
|
|
Acolyte
Joined: 19 Feb 2010 Posts: 65 Location: Detroit,Michigan,USA.
|
Having an issue with adding SECOND to the input timestamp comes as string.
Input Timestamp(Character type) = 20140720T164607
Input Timestamp Format = 'yyyyMMdd''T''HHmmss'
In-order to add the SECOND to it, I would need to convert the character to TIMESTAMP, but all the conversion that i have been trying are failing. The latest one that i am trying is this.
DECLARE startTimeStamp CHAR '20140720T164607';
DECLARE startTimeFormated TIMESTAMP CAST(startTimeStamp AS CHARACTER FORMAT 'yyyyMMdd''T''HHmmss');
But this is failing, can anyone help on this? Any help on this is much appreciated.
Thanks
SJ |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jul 24, 2014 8:50 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
First, the model should be converting this to a TIMESTAMP for you, before you ever see it as a string.
Second, "this is failing" is not an error message.
Third, you don't appear to be casting to a timestamp at all. |
|
Back to top |
|
 |
wmb_wps_soa |
Posted: Thu Jul 24, 2014 9:09 am Post subject: |
|
|
Acolyte
Joined: 19 Feb 2010 Posts: 65 Location: Detroit,Michigan,USA.
|
Thanks mqjeff. I got it working with the below CAST'ng.
DECLARE currentTimeFormated TIMESTAMP CAST('20140720164607' AS TIMESTAMP FORMAT 'yyyyMMddHHmmss');
Note: Had to remove the 'T' |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|