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 » Need eSQL statement to format Current Date/Time

Post new topic  Reply to topic
 Need eSQL statement to format Current Date/Time « View previous topic :: View next topic » 
Author Message
jrsetters
PostPosted: Mon Aug 27, 2012 6:22 am    Post subject: Need eSQL statement to format Current Date/Time Reply with quote

Acolyte

Joined: 24 Aug 2011
Posts: 72
Location: Cincinnati, OH

It seems like this would be pretty simple, but I have to admit I feel a little dumber every time I try to figure it out.

I simply want to take the current date and time and format it to:

Day of Week Month.Year.Day hh:mm:ss

Following the documentation, I thought the proper format would be:

EEE MMM.dd.yyyy HH:mm:ss

But I just get an exception every time. I am sure it is because I am not using the proper syntax when I get the date and time. I am setting it as a CHAR from the Current_Timestamp then pulling a substring from 12 for 26 (ie 2012-08-27 10:04:32.969620).

Does anyone have something similar that works?
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 27, 2012 6:40 am    Post subject: Re: Need eSQL statement to format Current Date/Time Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

jrsetters wrote:
But I just get an exception every time.


What exception?

jrsetters wrote:
I am setting it as a CHAR from the Current_Timestamp then pulling a substring from 12 for 26 (ie 2012-08-27 10:04:32.969620).


Do you mean you're casting it into a char, and what's the substring for?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jrsetters
PostPosted: Mon Aug 27, 2012 6:41 am    Post subject: Reply with quote

Acolyte

Joined: 24 Aug 2011
Posts: 72
Location: Cincinnati, OH

Never mind, I found it. It was that whole thing about setting a monkey in front of a typewriter for a thousand years.:

SET NOW = CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT 'EEE MMMM.dd.yyyy HH:mm:ss');
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 27, 2012 6:58 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

jrsetters wrote:
Never mind, I found it. It was that whole thing about setting a monkey in front of a typewriter for a thousand years.:

SET NOW = CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT 'EEE MMMM.dd.yyyy HH:mm:ss');


I was sort of thinking something like that should work.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » Need eSQL statement to format Current Date/Time
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.