SQL

MSSQL NOTE – retrieving rows less than 90 days old

Selecting inventory records from an inventory database, I only want records for computers that have been scanned in the last ninety days.

Simply solution using DATEDIFF

SELECT * FROM [inventoryt table]

WHERE (DATEDIFF([DAYOFYEAR], [LastScanDate],GETDATE()))< 90