Share via

string date search - previous month

arkiboys 9,711 Reputation points
2022-06-07T06:51:47.54+00:00

In pyspark databricks I am loading data into delta table...
One of the columns is HireDate which comes in as string, i.e. 20220530
20220421
20220607
...
Question,
What is the select query to return all rows but for previous month
i.e. where HireDate >= 1st of previous month and HireDate < = last day of previous month

Thank you

Azure Databricks
Azure Databricks

An Apache Spark-based analytics platform optimized for Azure.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.