Author: Rohit Umarjikar
Posted: Thu Aug 18, 2016 9:26 pm (GMT 5.5)
VARCHAR_FORMAT - J (Integer format too)- Julian day (number of days since January 1, 4713 BC). Try this,
or this,
_________________
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]()
Posted: Thu Aug 18, 2016 9:26 pm (GMT 5.5)
VARCHAR_FORMAT - J (Integer format too)- Julian day (number of days since January 1, 4713 BC). Try this,
Code: |
SELECT concat(year(current date),DAYS(CURRENT_TIMESTAMP) - DAYS(SUBSTR(CHAR(CURRENT_TIMESTAMP),1,4)||'-01-01') + 1) FROM SYSIBM.SYSDUMMY1 |
Code: |
select CAST(TRIM(CHAR(YEAR(current date)))|| REPEAT('0',(3-LENGTH(TRIM(CHAR(DAYOFYEAR(current date))))))|| TRIM(CHAR(DAYOFYEAR(current date))) AS CHAR(7)) from sysibm.sysdummy1 |
_________________
Regards,
Rohit Umarjikar
"Knowledge is knowing that a tomato is a fruit, but Wisdom is knowing not to put it in a fruit salad."
