Hello there.
I created a report a while ago to get a list of computers and display what ou they are in as one of the fields in the report.
The report is morphing into a show all computers that do not have certain letters in the name, and belong to specific OU's like. I cannot seem to get the like OU's part correct. I've done some searching on the net and cannot find a good example to make it work. Below is the report with the incorrect OU's like. Any direction or help is appreciated.
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblADComputers.OU,
tblAssets.Lastseen,
tblAssetCustom.Building,
tblAssetCustom.Department,
tblAssets.Description,
tblADusers.Username,
tblADusers.Displayname,
tblADusers.Telephone,
tblADusers.email,
tblAssets.Version,
tblAssetCustom.Model,
tblOperatingsystem.Caption
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblADusers On tblADusers.Username = tblAssets.Username
Inner Join tblOperatingsystem On
tblAssets.AssetID = tblOperatingsystem.AssetID
Where tblAssets.AssetName Not Like '%spr%' And tblAssets.AssetName Not
Like '%wv%' And tblAssets.AssetName Not Like '%win%' And
tblAssets.AssetName Not Like '%cli%' And tblADComputers.OU Like '%ou1%' And
tblADComputers.OU Like '%ou2%' And tblADComputers.OU Like '%ou3%' And
tblAssetCustom.State = 1