08-07-2019 08:25 PM
08-09-2019 04:55 PM
Select Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssetCustom.PurchaseDate,
tblBIOS.ReleaseDate AS [BIOS Date],
CASE
WHEN tblAssetCustom.PurchaseDate IS NOT Null
THEN DateDiff(dd, tblAssetCustom.PurchaseDate, GetDate()) / 365.25
ELSE DateDiff(dd, tblBIOS.ReleaseDate, GetDate()) / 365.25
END As [Age]
From
tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblBIOS ON tblBIOS.AssetID = tblAssets.AssetID
Where
tblAssetCustom.State = 1
FROMlinks in the table containing the BIOS information.
...
Inner Join tblBIOS ON tblBIOS.AssetID = tblAssets.AssetID
SELECTdisplays the BIOS date.
...
tblBIOS.ReleaseDate AS [BIOS Date],
...
SELECTuses either the purchase date, if available (PurchaseDate IS NOT NULL), or the BIOS date if the purchase date is not available, to calculate the age in years.
...
CASE
WHEN tblAssetCustom.PurchaseDate IS NOT Null
THEN DateDiff(dd, tblAssetCustom.PurchaseDate, GetDate()) / 365.25
ELSE DateDiff(dd, tblBIOS.ReleaseDate, GetDate()) / 365.25
END As [Age]
...
08-09-2019 03:01 PM
08-08-2019 10:30 PM
Select Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblBIOS.ReleaseDate AS [BIOS Date],
DateDiff(dd, tblBIOS.ReleaseDate, GetDate()) / 365.25 As [BIOS Age]
From
tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblBIOS ON tblBIOS.AssetID = tblAssets.AssetID
Where
tblAssetCustom.State = 1
Select Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssetCustom.PurchaseDate,
tblBIOS.ReleaseDate AS [BIOS Date],
CASE
WHEN tblAssetCustom.PurchaseDate IS NOT Null
THEN DateDiff(dd, tblAssetCustom.PurchaseDate, GetDate()) / 365.25
ELSE DateDiff(dd, tblBIOS.ReleaseDate, GetDate()) / 365.25
END As [Age]
From
tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblBIOS ON tblBIOS.AssetID = tblAssets.AssetID
Where
tblAssetCustom.State = 1
08-08-2019 09:57 PM
08-08-2019 09:46 PM
08-08-2019 09:25 PM
08-08-2019 08:52 PM
08-08-2019 07:55 PM
Select Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried
From
tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Where
tblAssetCustom.State = 1
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
Wheresays "where the asset is active" (i.e. it has been seen by LANSweeper within the last 90 days).
tblAssetCustom.State = 1
Where
tblAssetCustom.State = 1
And DateDiff(dd, tblAssetCustom.PurchaseDate, GetDate()) / 365.25 >= 4
Where
tblAssetCustom.State = 1
And ( tblAssetCustom.PurchaseDate Is Null
OR DateDiff(dd, tblAssetCustom.PurchaseDate, GetDate()) / 365.25 >= 4
)
Where
tblAssetCustom.State = 1
And tsysAssetTypes.AssetTypename = 'Windows'
And ( tblAssetCustom.PurchaseDate Is Null
OR DateDiff(dd, tblAssetCustom.PurchaseDate, GetDate()) / 365.25 >= 4
)
08-08-2019 06:50 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now