Hi @Skv, The issue you're experiencing could be using uppercase’ YYYY-MM-DD’ in your date format.
In Spark 3.0 and above, which includes current versions of Databricks Runtime, the DateTimeFormatter doesn't recognize’ YYYY-MM-DD’ as a valid date pattern. Instead, using the lowercase’ yyyy-MM-dd’ would be best.
Therefore, your query should be:
sql
SELECT * FROM Test.TestSchema.Address where TO_DATE(TO_VARCHAR(MODIFIEDDATE,'yyyy-MM-dd')) = '2023-09-10'
This behaviour change is due to the migration from the combination of Julian and Gregorian calendars to the Proleptic Gregorian calendar in Spark 3.0 and above. This could be why your query works in Snowflake but not Databricks.
Sources:
- [Using datetime values in Spark 3.0 and above](https://kb.databricks.com/sql/using-datetime-values-in-spark-30-and-above)