Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将 Julian 格式的数字“yyyyddd”转换为 Teradata 中的正确日期值?例如从“2014001”到“2014-01-01”。
请提供两个示例,第一个是“2014001”是数字,第二个是字符。
非常感谢!
经过反复试验,我找到了答案。
如果数据是字符,则:
Cast(<Column Name> As Date Format ‘yyyyddd’)
如果数据是数字,则:
Cast(Cast(<Column Name> As Char(7)) As Date Format ‘yyyyddd’)