Working with a claims table, I want to keep the past two years claims based on the received date. I have come up with this and was wondering if this was the best approach? Or is there possibly a better approach? FYI, the entereddate is a datetime field.
SELECT * from claim
where dateadd(yyyy,-2,convert(varchar(10),getdate(),101))
> convert(varchar(10),entereddate,101)
order by entereddate
Help is appreciated.
SELECT * from claim
where dateadd(yyyy,-2,convert(varchar(10),getdate(),101))
> convert(varchar(10),entereddate,101)
order by entereddate
Help is appreciated.