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 » Formatting Date info retrieved from Datebase to a string

Post new topic  Reply to topic
 Formatting Date info retrieved from Datebase to a string « View previous topic :: View next topic » 
Author Message
kumar.shanj
PostPosted: Thu Dec 09, 2010 2:39 am    Post subject: Formatting Date info retrieved from Datebase to a string Reply with quote

Apprentice

Joined: 18 Nov 2010
Posts: 49

I am trying to do a substring a date value retieved from DB and getting error while running it.

I am retrieving a attibute from DB which is of type DateTime in SQL DB.

I need to retrieve only year and month information from the date.

My code looks like this :

DECLARE dateStr3 CHARACTER;
SET dateStr3 = (CAST TransactionRef.RIR_EndDate as CHARACTER format 'yyyMM');
--where TransactionRef.RIR_EndDate is DateTime retrieved from DB

Pls help
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Dec 09, 2010 3:14 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

what's the error you're getting?

What's the usertrace show?
Back to top
View user's profile Send private message
kash3338
PostPosted: Mon Dec 13, 2010 3:25 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

How do you retrive the value from DB? When you retrive a value from DB, it is stored as a String (CHAR) value in ESQL.

First CAST the value to DATE and store in a DATE Variable in ESQL, then CAST the DATE Variable to the required format.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Formatting Date info retrieved from Datebase to a string
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.