12-08-2016 03:50 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssetCustom.PurchaseDate,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblState.Statename,
tblADComputers.Location,
tblAssets.Description,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssetCustom.Custom3 As Company,
tblAssetCustom.Custom2 As Status
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblDomainroles On tblDomainroles.Domainrole =
tblComputersystem.Domainrole
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblState On tblState.State = tblAssetCustom.State
Where tblAssetCustom.Manufacturer Like '%dell%' And
tblADComputers.OU Not Like '%waltham%' And tsysAssetTypes.AssetTypename =
'Windows' And tblDomainroles.Domainrole < 2
Order By tblAssetCustom.PurchaseDate
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssetCustom.PurchaseDate,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblState.Statename,
tblADComputers.Location,
tblAssets.Description,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssetCustom.Custom3 As Company,
tblAssetCustom.Custom2 As Status
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblDomainroles On tblDomainroles.Domainrole =
tblComputersystem.Domainrole
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblState On tblState.State = tblAssetCustom.State
Where tblAssetCustom.Custom2 Not Like '%retired%' And
tblAssetCustom.Manufacturer Like '%dell%' And tblADComputers.OU Not Like
'%waltham%' And tsysAssetTypes.AssetTypename = 'Windows' And
tblDomainroles.Domainrole < 2
Order By tblAssetCustom.PurchaseDate
Solved! Go to Solution.
12-15-2016 05:09 PM
Where tblAssetCustom.Custom2 Not Like '%retired%' And
tblAssetCustom.Manufacturer Like '%dell%' And tblADComputers.OU Not Like
'%waltham%' And tsysAssetTypes.AssetTypename = 'Windows' And
tblDomainroles.Domainrole < 2
Where (tblAssetCustom.Custom2 Not Like '%retired%' Or
tblAssetCustom.Custom2 is NULL) And
tblAssetCustom.Manufacturer Like '%dell%' And tblADComputers.OU Not Like
'%waltham%' And tsysAssetTypes.AssetTypename = 'Windows' And
tblDomainroles.Domainrole < 2
12-15-2016 05:09 PM
Where tblAssetCustom.Custom2 Not Like '%retired%' And
tblAssetCustom.Manufacturer Like '%dell%' And tblADComputers.OU Not Like
'%waltham%' And tsysAssetTypes.AssetTypename = 'Windows' And
tblDomainroles.Domainrole < 2
Where (tblAssetCustom.Custom2 Not Like '%retired%' Or
tblAssetCustom.Custom2 is NULL) And
tblAssetCustom.Manufacturer Like '%dell%' And tblADComputers.OU Not Like
'%waltham%' And tsysAssetTypes.AssetTypename = 'Windows' And
tblDomainroles.Domainrole < 2
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now