How do I convert a numeric in Julian format 'yyyyddd' to a proper Date value in Teradata? For example from '2014001' to '2014-01-01'.
Please provide two examples, first when '2014001' is a numeric and second when it is a character.
Many Thanks!
How do I convert a numeric in Julian format 'yyyyddd' to a proper Date value in Teradata? For example from '2014001' to '2014-01-01'.
Please provide two examples, first when '2014001' is a numeric and second when it is a character.
Many Thanks!
After some trial-and-error I've found the answer.
If the data is character, then:
Cast(<Column Name> As Date Format ‘yyyyddd’)
If the data is numeric, then:
Cast(Cast(<Column Name> As Char(7)) As Date Format ‘yyyyddd’)