→ The Lansweeper Customer Excellence Awards 2024 - Submit Your Project Now! Learn More & Enter Here
‎02-26-2019 04:21 PM
Solved! Go to Solution.
‎02-28-2019 04:37 PM
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssetCustom.PurchaseDate,
DateDiff(dd, tblAssetCustom.PurchaseDate, GetDate()) / 365.25 As Age
FROM
tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
WHERE
tblAssetCustom.State = 1 -- active assets
AND tblAssets.AssetType = -1 -- only Windows assets
AND DateDiff(dd, tblAssetCustom.PurchaseDate, GetDate()) / 365.25 < 4 -- less than 4y old
ORDER BY
tblAssetCustom.PurchaseDate
‎03-04-2019 07:48 PM
‎02-28-2019 04:37 PM
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssetCustom.PurchaseDate,
DateDiff(dd, tblAssetCustom.PurchaseDate, GetDate()) / 365.25 As Age
FROM
tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
WHERE
tblAssetCustom.State = 1 -- active assets
AND tblAssets.AssetType = -1 -- only Windows assets
AND DateDiff(dd, tblAssetCustom.PurchaseDate, GetDate()) / 365.25 < 4 -- less than 4y old
ORDER BY
tblAssetCustom.PurchaseDate
‎02-27-2019 10:44 PM
‎02-28-2019 02:33 PM
RC62N wrote:
The pointer wasn't intended as "somebody already asked the exact same question, here's the solution" but "here's something sufficiently similar to what you're asking that you can use it to figure out your report without much effort".
Create the report with the fields you want. Use DateDiff() with the purchased-date field, as was done in that other report with the last-seen date, to calculate how long ago each machine was purchased.
‎02-27-2019 08:04 PM
‎02-27-2019 08:19 PM
RC62N wrote:
See this thread.
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now