Convert integer to date using SQL in iSeries DB2

/ Published in: SQL
Save to your folder(s)

intfield has this format: YYYYMMDD

Copy this code and paste it in your HTML
  2. DATE(substr(CHAR(intfield), 1, 4) || '-'|| substr(CHAR(intfield),5, 2) || '-'|| substr(CHAR(intfield), 7, 2)) AS datefield
  3. FROM file1

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.