I reviewed the report the other user sent and found errors. Try the one I created below:
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssetCustom.Manufacturer,
Case
When tblAssetCustom.PurchaseDate Is Not Null Then DateDiff(day,
tblAssetCustom.PurchaseDate, GetDate()) Else '0' End As [Days Old],
tblAssets.Userdomain + '\' + tblAssets.Username As [Last User],
tblADusers.Name,
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Outer Join tblADusers On tblADusers.Username = tblAssets.Username And
tblADusers.Userdomain = tblAssets.Userdomain
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Where tblAssetCustom.State = 1 And tblComputersystem.Domainrole <= 1
This does require you have a purchase date filled out, otherwise it will display 0 for the days old column.
Thank you,
Jeffrey Smith
Enterprise Applications Security
(319) 499-6310
JefSmith@geico.com