SELECT ItemCode FROM Invoice GROUP BY ItemCode HAVING MAX(SaleDate) < DATEADD(year, -2, GETDATE())
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)