I´m currently working on a SQL statement that should filter the last 5 years data. The datatype that i wish to filter from is an "int"-column and the data is for example "201901" (year/month). I don´t want to have specific years/months in the query since it will be used every day/every year.
I´m stuck with how to write the query when the column is'nt a datetime datatype.
I tried with different dateadd/datefromparts but it doesnt work.
First convert to date type like so and then filter on it.
see answer below Converting Integer to Date