Joined: 26 Nov 2002 Posts: 12359 Topics: 75 Location: San Jose
Posted: Thu Jul 27, 2017 1:01 pm Post subject:
NASCAR9,
Thanks for sharing. I would prefer using TO_CHAR instead of Varchar format as it would give you extra 2 bytes for length.
Code:
SELECT TO_CHAR(CURRENT DATE,'YYYYMMDD')
FROM SYSIBM.SYSDUMMY1
;
or
SELECT TO_CHAR(CURRENT DATE,'MMDDYYYY')
FROM SYSIBM.SYSDUMMY1
;
or
SELECT TO_CHAR(CURRENT DATE,'DD-MON-YYYY')
FROM SYSIBM.SYSDUMMY1
;
You can also format the numbers with comma's as shown in this topic
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