0

I need to change a column that looks like this =" 202007211330231166 " into time stamp or date format = 21/07/2020 & time = 1:30 pm i.e. (1330 <- part) Help. I was attempting to use Substring to capture the date & time sections.

select InfoData from dbc.dbcinfoV where InfoKey = 'RELEASE'; = version of Teradata 16.20.53.13

J J
  • 1
  • 2

1 Answers1

1

You're on the right track, split the string and then CAST it:

cast(substring(col from 1 for 8) as date format 'yyyymmdd')
cast(substring(col from 9 for 4) as time(0) format 'hhmi')
dnoeth
  • 59,503
  • 4
  • 39
  • 56