ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Adding Seconds to 20140720T164607 ('yyyyMMdd''T''HHmmss')

Post new topic  Reply to topic
 Adding Seconds to 20140720T164607 ('yyyyMMdd''T''HHmmss') « View previous topic :: View next topic » 
Author Message
wmb_wps_soa
PostPosted: Thu Jul 24, 2014 7:53 am    Post subject: Adding Seconds to 20140720T164607 ('yyyyMMdd''T''HHmmss') Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Thu Jul 24, 2014 8:50 am    Post subject: Reply with quote

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
View user's profile Send private message
wmb_wps_soa
PostPosted: Thu Jul 24, 2014 9:09 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Adding Seconds to 20140720T164607 ('yyyyMMdd''T''HHmmss')
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.