I need to create a process where anything older than six months we would write to an archive table and delete the records from the inventory table. Our inv table is huge btw lets use (x) as the number. So i need query to select anything that has an end date that is six months or older and write the SQL. Does this make sense?
Where End_Date <= dateadd(month, -6, getdate())
Since we want to go back 6 months we add -6 to today's date, which is the last parameter in the formula (getdate() get's today's date from the server). This will yield an answer of 10/8/2020 So any end date on the table that is less than or equal to 10/8/2020 will be selected to the results .
If this doesn't make sense or you need more info let me know.