DB2 Date format

后端 未结 5 1766
粉色の甜心
粉色の甜心 2020-12-31 03:08

I just want to format current date into yyyymmdd in DB2.

I see the date formats available, but how can I use them?

http://publib.boulder.ibm.com

5条回答
  •  时光取名叫无心
    2020-12-31 03:41

    Current date is in yyyy-mm-dd format. You can convert it into yyyymmdd format using substring function:

    select substr(current date,1,4)||substr(current date,6,2)||substr(currentdate,9,2)
    

提交回复
热议问题