Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 11:20 AM
Hi @David_Billa,
Can you try with:
TO_TIMESTAMP("12/30/2022 12:00:00 AM", "MM/dd/yyyy hh:mm:ss a") AS tsDate
The issue you are encountering with the TO_DATE function returning null for the value "12:00:00 AM" is likely due to the format string not matching the input string correctly. The TO_DATE function in Databricks requires the format string to precisely match the input string for it to parse the date correctly
https://docs.databricks.com/ja/sql/language-manual/functions/to_timestamp.html