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 » DATE TYPE

Post new topic  Reply to topic
 DATE TYPE « View previous topic :: View next topic » 
Author Message
balu2608
PostPosted: Sat Jan 12, 2013 1:19 am    Post subject: DATE TYPE Reply with quote

Apprentice

Joined: 18 May 2012
Posts: 39

Hi All,

Can anyone suggest me how can we convert STRING type to DATE Type in esql....
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sat Jan 12, 2013 1:49 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

How are you trying to do it?
If you have, what errors have you encountered?

It really does help us to know all the facts (such as those above).
_________________
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
View user's profile Send private message
visasimbu
PostPosted: Sat Jan 12, 2013 2:09 am    Post subject: Reply with quote

Disciple

Joined: 06 Nov 2009
Posts: 171

Check the link

or the code

Code:
DECLARE source CHARACTER '01-02-03';
DECLARE target DATE;
DECLARE pattern CHARACTER 'dd-MM-yy';
SET target = CAST(source AS DATE FORMAT pattern);
-- target now contains Year=2003, Month=02, Day=01


Last edited by visasimbu on Sat Jan 12, 2013 8:46 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
balu2608
PostPosted: Sat Jan 12, 2013 4:06 am    Post subject: DECLARE source CHARACTER '01-02-03'; Reply with quote

Apprentice

Joined: 18 May 2012
Posts: 39

Hi Visa,

Even iam trying in the same method but its throwing an eror has invalid data type..
Back to top
View user's profile Send private message
visasimbu
PostPosted: Sat Jan 12, 2013 8:43 am    Post subject: Re: DECLARE source CHARACTER '01-02-03'; Reply with quote

Disciple

Joined: 06 Nov 2009
Posts: 171

balu2608 wrote:
Even iam trying in the same method but its throwing an eror has invalid data type..


What you have written in your esql code ?
Place the full exception here..
or
If you place the trace, it gives more detailed explanation of the error.

Quote:
Hi Visa,

Call me Simbu.
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Sat Jan 12, 2013 9:31 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Hi 2608 -
You spend a lot of time here asking for basic and simple help.

It must be very frustrating for you.

In my long career, I have found a simple way to relieve that kind of frustration.

I repeated beat my head against the documentation, in a metaphoric sense these days now that it's all electronic and not printed. Eventually, the documentation starts to sink in and make sense.

I augment this daily ritual of relieving frustration by trying things that immediately fail. Then I waste a lot of time trying to make them work, which generates more frustration.

Eventually this cycle of frustration relieved by self-punishment via documentation leading to increased frustration from failing to achieve things leads to learning.

And learning leads to success.

I realize this is not a terribly helpful response, and it's not a very easy road to follow.

But I can say it has actually worked.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Sat Jan 12, 2013 11:33 am    Post subject: Re: DECLARE source CHARACTER '01-02-03'; Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

balu2608 wrote:
Even iam trying in the same method but its throwing an eror has invalid data type.

Unfortunately, nobody else can see the offending source code, or actual error message.

Posting any relevant details up front, rather than waiting for someone to ask for them, can help resolve the problem more quickly.
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 » DATE TYPE
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.