How to filter dates prior to my current period

Hi Team,

Please see my below dates FYR. the dates are dynamic.

I need to filter the dates which is prior to my current period say for example : now we are in June 2022 so i need to select the previous year including previous months such as 2020(all the months) and 2021(all the months) 2022(Jan, Feb, March, April, may) and remove future years like 2023, 2024, 2025 so on…how do i achieve this…

below is the output required:

Read Range to a data table, filter dates based on the period using filter data table activity or by looping through rows and write the filtered data table back to Excel.

Hi anas,

The date is not constant so hw do i select only previous month all the time.

You can put an if condition, something like datetime.parse(currentrow.item(“Date column”).tostring) < datetime.parse(your_period)