‎06-08-2015 06:08 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssetCustom1.Model,
tblADComputers.Description As [A.D. Description],
tblADusers.Displayname,
tblAssetCustom.PurchaseDate
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblAssetCustom tblAssetCustom1 On tblAssets.AssetID =
tblAssetCustom1.AssetID
Inner Join tblADusers On tblADusers.Username = tblAssets.Username
Where tblAssetCustom.PurchaseDate > DateAdd(YEAR, -5, GetDate()) And
tblAssetCustom.State = 1
Solved! Go to Solution.
‎06-09-2015 06:49 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssetCustom.Model,
tblADComputers.Description As [A.D. Description],
tblADusers.Displayname,
tblAssetCustom.PurchaseDate
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Left Join tblADusers On tblADusers.Username = tblAssets.Username And
tblAssets.Userdomain = tblADusers.Userdomain
Where 5 < DateDiff(YEAR, tblAssetCustom.PurchaseDate, GetDate()) And
tblAssetCustom.State = 1
‎01-20-2023 09:02 AM
Hi!! That query works fine, but in my situation I only get the branded computers like HP, DELL, Toshiba, etc. For custom computers without brand doesn't show any result. Is there any other filed on the query I can use like bios or motherboard to have a similar results for all the computers?? Thank you in advance.
‎06-10-2015 02:53 PM
Where 60 < DateDiff(MONTH, tblAssetCustom.PurchaseDate, GetDate())
‎06-09-2015 09:48 PM
‎06-09-2015 06:49 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssetCustom.Model,
tblADComputers.Description As [A.D. Description],
tblADusers.Displayname,
tblAssetCustom.PurchaseDate
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Left Join tblADusers On tblADusers.Username = tblAssets.Username And
tblAssets.Userdomain = tblADusers.Userdomain
Where 5 < DateDiff(YEAR, tblAssetCustom.PurchaseDate, GetDate()) And
tblAssetCustom.State = 1
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now