Reputation: 125
I have a string date formatted as 20190101 that I'm trying to convert to 2019-01-01. How would I do this in standard? I know in legacy I could simply do date('20190101'), but not sure how to do this in standard.
Thank you
Upvotes: 0
Views: 167
Reputation: 6524
Easy:
SELECT PARSE_DATE('%Y%m%d', '20190101')
Format elements for date is here:
Upvotes: 1
Reputation: 1269773
Use PARSE_DATE()
:
select PARSE_DATE('%Y%m%d', '20190101')
Upvotes: 3