Hi does anyone know how to convert a string in YYYYMMDD format to yyyy-mm-dd in duck db?
have tried to cast, have tried strptime(date, 'yyyymmdd'), have tried convert, to_date
Hi does anyone know how to convert a string in YYYYMMDD format to yyyy-mm-dd in duck db?
have tried to cast, have tried strptime(date, 'yyyymmdd'), have tried convert, to_date
You can do so like this
SELECT strftime(DATE your_string, '%Y-%m-%d');
See duckdb documentation for more information :)
You could also try converting the string first outside of duck db like so:
string.strftime('%Y-%m-%d')
and then passing it to duck db.