I have table1 with data
file Startdate
A 2020-05-01
B 2020-06-01
We have today is 2020-06-01 and I could use Select and where startdate ='2020-06-01'
But I try this query and not get 2020-06-01
select file from table1
where
startdate >= dateadd(month, -1, datefromparts(year(getdate()), month(getdate()), 1))
and startdate < datefromparts(year(getdate()), month(getdate()), 1)
Please correct me. Thank you