|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
DATETIME to yyyyMMdd format |
« View previous topic :: View next topic » |
Author |
Message
|
brokendrum |
Posted: Fri Feb 28, 2003 8:23 am Post subject: DATETIME to yyyyMMdd format |
|
|
Apprentice
Joined: 14 Jan 2003 Posts: 34
|
I'm trying to output a DATETIME format as yyyyMMdd but I still get the DATETIME (yyyy-MM-dd hh:mm:ss) in the outbound XML message. I've declared the <ValueDate> XML element in the MRM as a type of DATETIME and the Format as yyyyMMdd.
Any help would be greatly appreciated!
Thanks. |
|
Back to top |
|
 |
yaakovd |
Posted: Fri Feb 28, 2003 8:50 am Post subject: |
|
|
Partisan
Joined: 20 Jan 2003 Posts: 319 Location: Israel
|
I'm using following:
Code: |
XXX = CAST(EXTRACT(YEAR FROM CURRENT_DATE) AS CHARACTER) ||
SUBSTRING((CAST(100 + EXTRACT(MONTH FROM CURRENT_DATE)AS CHARACTER)) FROM 2 FOR 3) ||
SUBSTRING((CAST(100 + EXTRACT(DAY FROM CURRENT_DATE)AS CHARACTER)) FROM 2 FOR 3) |
You can use any date instead of CURRENT_DATE. _________________ Best regards.
Yaakov
SWG, IBM Commerce, Israel |
|
Back to top |
|
 |
brokendrum |
Posted: Fri Feb 28, 2003 9:04 am Post subject: |
|
|
Apprentice
Joined: 14 Jan 2003 Posts: 34
|
That would probably work, but can you not define the date format in the MRM that you want the DATETIME to be output in? It reads yymmdd when it parses the input message and expresses it as DATETIME yyyy-mm-dd hh:mm:ss in the message tree. I want to use the reverse function of this. |
|
Back to top |
|
 |
yaakovd |
Posted: Fri Feb 28, 2003 9:14 am Post subject: |
|
|
Partisan
Joined: 20 Jan 2003 Posts: 319 Location: Israel
|
Actually, in my application I always send/receive Date as String.
If I need to compare it with CURRENT_DATE or Date from DB, I convert it.
So, also in your MRM you can define it as String.
Or you can create functions (in 2.1) Date to String and vice versa, special if you have single date format.
For reverse function you can use SUBSTRING. _________________ Best regards.
Yaakov
SWG, IBM Commerce, Israel |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|