Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

DB2 :: RE: Low values Results from VARCHAR FORMAT

$
0
0
Author: Rohit Umarjikar
Posted: Thu Oct 20, 2016 3:01 am (GMT 5.5)

Code:
SELECT
VARCHAR_FORMAT(CURRENT_DATE,'YYYY.MM.DD')
 ||'|'||
VARCHAR_FORMAT(CURRENT_DATE,'YYYY/MM/DD')
 || '|'
 FROM SYSIBM.SYSDUMMY1


Output:
Code:
 1
 ----------------------
 2016.10.19|2016/10/19|

This should work for you, there is no reason to use cast unless required also why you gave ',' after each date? I thought you wanted as one string. What you posted may not be true as we don't see that is happening and just because you say so we cannot waste time on that. please try with this and let us know.
_________________
Regards,
Rohit Umarjikar
"Knowledge is knowing that a tomato is a fruit, but Wisdom is knowing not to put it in a fruit salad."icon_razz.gif


Viewing all articles
Browse latest Browse all 9405

Trending Articles