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 IndexWebSphere Message Broker SupportCAST DATE FORMAT

Post new topicReply to topic
CAST DATE FORMAT View previous topic :: View next topic
Author Message
Phanikumar
PostPosted: Tue Jul 17, 2018 10:05 pm Post subject: CAST DATE FORMAT Reply with quote

Apprentice

Joined: 29 Aug 2016
Posts: 25
Location: Kuwait

Hi All,

How to cast the date format dd-MM-yyyy to yyyy-MM-dd in ESQL. I've tried double cast but nothing is working.
_________________
Saying what you feel. It's not being rude, it's called being real.
Back to top
View user's profile Send private message Send e-mail
abhi_thri
PostPosted: Tue Jul 17, 2018 10:40 pm Post subject: Reply with quote

Master

Joined: 17 Jul 2017
Posts: 217
Location: UK

hi...if the input field is of date/timestamp type you can convert it to string using FORMAT as described at the infocenter topic

If the input is not a date then you need to cast it to date first followed by FORMAT to string operation,

CAST(CAST(inputDate AS DATE FORMAT 'dd-MM-yyyy') AS CHAR FORMAT 'yyyy-MM-dd');
Back to top
View user's profile Send private message
timber
PostPosted: Wed Jul 18, 2018 1:24 am Post subject: Reply with quote

Sentinel

Joined: 25 Aug 2015
Posts: 856

Quote:
I've tried double cast but nothing is working
That is not a good problem statement. If you want help with a technical problem, you will need to invest more time in describing what you did, and what happened.
Back to top
View user's profile Send private message
Phanikumar
PostPosted: Wed Jul 18, 2018 5:37 am Post subject: Reply with quote

Apprentice

Joined: 29 Aug 2016
Posts: 25
Location: Kuwait

timber wrote:
Quote:
I've tried double cast but nothing is working
That is not a good problem statement. If you want help with a technical problem, you will need to invest more time in describing what you did, and what happened.


I tried CAST (CAST(cSlDate AS CHAR FORMAT) AS CHAR FORMAT 'yyyy-MM-dd'); however, I've got this.

Next time i post with more descriptions. Thanks for your reply.
_________________
Saying what you feel. It's not being rude, it's called being real.
Back to top
View user's profile Send private message Send e-mail
Phanikumar
PostPosted: Wed Jul 18, 2018 5:38 am Post subject: Reply with quote

Apprentice

Joined: 29 Aug 2016
Posts: 25
Location: Kuwait

abhi_thri wrote:
hi...if the input field is of date/timestamp type you can convert it to string using FORMAT as described at the infocenter topic

If the input is not a date then you need to cast it to date first followed by FORMAT to string operation,

CAST(CAST(inputDate AS DATE FORMAT 'dd-MM-yyyy') AS CHAR FORMAT 'yyyy-MM-dd');


Thank You, I've tried and it's working.
_________________
Saying what you feel. It's not being rude, it's called being real.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportCAST DATE FORMAT
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.