I have a table of records in which every morning, I want to update the records which have a start_date older than 15 months and set them to inactive status.
I thought using a raw number of days might work in a simple math calculation
SET active_yn = n
WHERE start_date < getdate()-450
But that doesn't work due to leap years or during february when there is only 28 days.