0

I have a column that called date with the following format : '20220816' how can I convert this column into Date format?

I tried to use this function : date_parse(date,'%y/%m/%d') but it keep giving me this error: NVALID_FUNCTION_ARGUMENT: Invalid format: "20220627" is malformed at "220627"

1 Answer 1

0

You have to remove the slashes from your query. Below query convert it to date format for you. Just replace the string with the column containing values

select cast(date_parse('20220816','%Y%m%d') as date)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.