→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
12-02-2014 07:31 AM
Solved! Go to Solution.
12-02-2014 05:13 PM
mott wrote:
I have a similar report, but in the first step I was forced to group my assets into Assetgroups (Desktop, Laptop).
CASE
WHEN tblPortableBattery.Manufacturer IS NOT NULL
THEN 'Notebook'
ELSE 'Desktop'
END As Class,
LEFT JOIN tblPortableBattery ON tblPortableBattery.AssetID = tblAssets.AssetID
12-02-2014 09:29 PM
12-02-2014 04:09 PM
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
12-02-2014 02:27 PM
12-02-2014 12:06 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Username,
tblAssets.Userdomain,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssetGroups.AssetGroup,
tblAssetCustom.PurchaseDate,
DateDiff(yy, tblAssetCustom.PurchaseDate, GetDate()) As Age,
tblAssetCustom.Manufacturer
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblAssetGroupLink On tblAssets.AssetID = tblAssetGroupLink.AssetID
Inner Join tblAssetGroups On tblAssetGroups.AssetGroupID =
tblAssetGroupLink.AssetGroupID
Inner Join tblOperatingsystem
On tblAssets.AssetID = tblOperatingsystem.AssetID
Where (tblAssetGroups.AssetGroup = 'Desktop' Or tblAssetGroups.AssetGroup =
'Laptop') And tblAssetCustom.State = 1
12-02-2014 05:13 PM
mott wrote:
I have a similar report, but in the first step I was forced to group my assets into Assetgroups (Desktop, Laptop).
CASE
WHEN tblPortableBattery.Manufacturer IS NOT NULL
THEN 'Notebook'
ELSE 'Desktop'
END As Class,
LEFT JOIN tblPortableBattery ON tblPortableBattery.AssetID = tblAssets.AssetID
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now