Trying to get desktops over 5 years old based off of the purchase date. Here's what I have so far... I'm new to SQL, so please forgive and inefficiencies. It doesn't seem to grab everything...am I missing something?
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssetCustom.Model,
tblAssetCustom.Manufacturer,
tblAssetCustom.Serialnumber,
tblAssetCustom.PurchaseDate,
tblAssetCustom.Warrantydate
From tblAssets
Left Outer Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblSystemEnclosure
On tblAssets.AssetID = tblSystemEnclosure.AssetID
Where (tblAssetCustom.PurchaseDate < GetDate() - 1825 And
tblSystemEnclosure.ChassisTypes = 3) Or
(tblAssetCustom.PurchaseDate < GetDate() - 1825 And
tblSystemEnclosure.ChassisTypes = 4) Or
(tblAssetCustom.PurchaseDate < GetDate() - 1825 And
tblSystemEnclosure.ChassisTypes = 6) Or
(tblAssetCustom.PurchaseDate < GetDate() - 1825 And
tblSystemEnclosure.ChassisTypes = 7) Or
(tblAssetCustom.PurchaseDate < GetDate() - 1825 And
tblSystemEnclosure.ChassisTypes = 13) Or
(tblAssetCustom.PurchaseDate < GetDate() - 1825 And
tblSystemEnclosure.ChassisTypes = 15) Or
(tblAssetCustom.PurchaseDate < GetDate() - 1825 And
tblSystemEnclosure.ChassisTypes = 16)
Order By tblAssetCustom.PurchaseDate