→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !
‎07-18-2013 12:53 AM
Solved! Go to Solution.
‎07-18-2013 05:04 PM
Select Top 1000000 tblAssetGroups.AssetGroup,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Username,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblSoftwareUni.softwareName,
tblSystemEnclosure.SMBIOSAssetTag,
tsysIPLocations.IPLocation,
tblAssetCustom.PurchaseDate
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblSystemEnclosure
On tblAssets.AssetID = tblSystemEnclosure.AssetID
Left Outer Join tsysIPLocations On tblAssets.IPNumeric >=
tsysIPLocations.StartIP And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Left Outer Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Inner Join tblAssetGroupLink On tblAssets.AssetID = tblAssetGroupLink.AssetID
Inner Join tblAssetGroups On tblAssetGroups.AssetGroupID =
tblAssetGroupLink.AssetGroupID
Where tblAssetGroups.AssetGroup <> 'Default group' And
(tblSoftwareUni.softwareName Like 'Microsoft Office Professional%' Or
tblSoftwareUni.softwareName Like 'Microsoft Office Standard%' Or
tblSoftwareUni.softwareName Like 'Microsoft Office 2007%' Or
tblSoftwareUni.softwareName Like 'Microsoft Office 2010%')
Union
Select Top 1000000 tblAssetGroups.AssetGroup,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Username,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblSoftwareUni.softwareName,
tblSystemEnclosure.SMBIOSAssetTag,
tsysIPLocations.IPLocation,
tblAssetCustom.PurchaseDate
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblSystemEnclosure
On tblAssets.AssetID = tblSystemEnclosure.AssetID
Left Outer Join tsysIPLocations On tblAssets.IPNumeric >=
tsysIPLocations.StartIP And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Left Outer Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Inner Join tblAssetGroupLink On tblAssets.AssetID = tblAssetGroupLink.AssetID
Inner Join tblAssetGroups On tblAssetGroups.AssetGroupID =
tblAssetGroupLink.AssetGroupID
Where tblAssetGroups.AssetGroup = 'Default group' And
(tblSoftwareUni.softwareName Like 'Microsoft Office Professional%' Or
tblSoftwareUni.softwareName Like 'Microsoft Office Standard%' Or
tblSoftwareUni.softwareName Like 'Microsoft Office 2007%' Or
tblSoftwareUni.softwareName Like 'Microsoft Office 2010%') And
tblAssets.AssetID Not In (Select tblAssetGroupLink.AssetID From tblAssetGroups
Where tblAssetGroups.AssetGroup <> 'Default group')
‎07-30-2013 02:00 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tsysAssetTypes.AssetTypeIcon10 As icon
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join (Select Top 1000000 tblAssetGroupLink.AssetID,
Count(tblAssetGroupLink.AssetGroupID) As Count
From tblAssetGroupLink
Group By tblAssetGroupLink.AssetID) SubQuery1 On SubQuery1.AssetID =
tblAssets.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Where tblAssetCustom.State = 1 And SubQuery1.Count = 1
Order By tblAssets.IPNumeric
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssetGroups.AssetGroup
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join (Select Top 1000000 tblAssetGroupLink.AssetID,
Count(tblAssetGroupLink.AssetGroupID) As Count
From tblAssetGroupLink
Group By tblAssetGroupLink.AssetID) SubQuery1 On SubQuery1.AssetID =
tblAssets.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
Where tblAssetCustom.State = 1 And SubQuery1.Count > 1
Order By tblAssets.IPNumeric
‎07-26-2013 11:31 PM
‎07-18-2013 05:04 PM
Select Top 1000000 tblAssetGroups.AssetGroup,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Username,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblSoftwareUni.softwareName,
tblSystemEnclosure.SMBIOSAssetTag,
tsysIPLocations.IPLocation,
tblAssetCustom.PurchaseDate
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblSystemEnclosure
On tblAssets.AssetID = tblSystemEnclosure.AssetID
Left Outer Join tsysIPLocations On tblAssets.IPNumeric >=
tsysIPLocations.StartIP And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Left Outer Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Inner Join tblAssetGroupLink On tblAssets.AssetID = tblAssetGroupLink.AssetID
Inner Join tblAssetGroups On tblAssetGroups.AssetGroupID =
tblAssetGroupLink.AssetGroupID
Where tblAssetGroups.AssetGroup <> 'Default group' And
(tblSoftwareUni.softwareName Like 'Microsoft Office Professional%' Or
tblSoftwareUni.softwareName Like 'Microsoft Office Standard%' Or
tblSoftwareUni.softwareName Like 'Microsoft Office 2007%' Or
tblSoftwareUni.softwareName Like 'Microsoft Office 2010%')
Union
Select Top 1000000 tblAssetGroups.AssetGroup,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Username,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblSoftwareUni.softwareName,
tblSystemEnclosure.SMBIOSAssetTag,
tsysIPLocations.IPLocation,
tblAssetCustom.PurchaseDate
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblSystemEnclosure
On tblAssets.AssetID = tblSystemEnclosure.AssetID
Left Outer Join tsysIPLocations On tblAssets.IPNumeric >=
tsysIPLocations.StartIP And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Left Outer Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Inner Join tblAssetGroupLink On tblAssets.AssetID = tblAssetGroupLink.AssetID
Inner Join tblAssetGroups On tblAssetGroups.AssetGroupID =
tblAssetGroupLink.AssetGroupID
Where tblAssetGroups.AssetGroup = 'Default group' And
(tblSoftwareUni.softwareName Like 'Microsoft Office Professional%' Or
tblSoftwareUni.softwareName Like 'Microsoft Office Standard%' Or
tblSoftwareUni.softwareName Like 'Microsoft Office 2007%' Or
tblSoftwareUni.softwareName Like 'Microsoft Office 2010%') And
tblAssets.AssetID Not In (Select tblAssetGroupLink.AssetID From tblAssetGroups
Where tblAssetGroups.AssetGroup <> 'Default group')
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now