cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
evan91
Engaged Sweeper
i try to exclude few values from report but it still contains them, can any1 tell me what i'm doing wrong ?:

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssetCustom.Manufacturer,
tblComputersystem.Model,
tblAssetCustom.Serialnumber As [Service Tag],
tblNetworkAdapter.Manufacturer As [Network Card Manufacturer],
tblNetworkAdapter.Name As [Network Card Name],
tblNetworkAdapter.MACAddress,
tblAssets.IPAddress,
tblAssets.Username,
tblAssets.Domain,
tblAssets.Processor,
tblBaseBoard.Product As Motherboard,
tblAssets.Memory,
tblOperatingsystem.Caption As OS,
tblAssets.Lastseen,
tblAssetCustom.PurchaseDate,
tblAssetCustom.Warrantydate,
tblAntivirus.DisplayName As Antyvirus,
tblAntivirus.productUpToDate,
tblSoundDevice.Caption As [Audio Card],
tblSoundDevice.Manufacturer As [Audio Card Manufacturer],
tblDiskdrives.Caption,
tblDiskdrives.Description As Partycja,
tblDiskdrives.FileSystem,
tblDiskdrives.Freespace,
tblDiskdrives.Size As [Disk Size]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblOperatingsystem
On tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblNetworkAdapter On tblAssets.AssetID = tblNetworkAdapter.AssetID
Inner Join tblAntivirus On tblAssets.AssetID = tblAntivirus.AssetID
Inner Join tblBaseBoard On tblAssets.AssetID = tblBaseBoard.AssetID
Inner Join tblSoundDevice On tblAssets.AssetID = tblSoundDevice.AssetID
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblDiskPartition On tblAssets.AssetID = tblDiskPartition.AssetID
Where (tsysAssetTypes.AssetTypename = 'Windows' And tblComputersystem.Model !=
'VMware Virtual Platform' And tblAntivirus.DisplayName != 'Windows Defender'
And tblSoundDevice.Caption != 'Audio dla wyświetlaczy Intel(R)' And
tblDiskdrives.FileSystem = 'FAT' And tblAssetCustom.State = 1) Or
(tblDiskdrives.FileSystem = 'FAT32') Or
(tblDiskdrives.FileSystem = 'NTFS')
Order By tblAssets.AssetName

1 ACCEPTED SOLUTION
KrisNelson
Champion Sweeper
I assuming you want the following:


Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssetCustom.Manufacturer,
tblComputersystem.Model,
tblAssetCustom.Serialnumber As [Service Tag],
tblNetworkAdapter.Manufacturer As [Network Card Manufacturer],
tblNetworkAdapter.Name As [Network Card Name],
tblNetworkAdapter.MACAddress,
tblAssets.IPAddress,
tblAssets.Username,
tblAssets.Domain,
tblAssets.Processor,
tblBaseBoard.Product As Motherboard,
tblAssets.Memory,
tblOperatingsystem.Caption As OS,
tblAssets.Lastseen,
tblAssetCustom.PurchaseDate,
tblAssetCustom.Warrantydate,
tblAntivirus.DisplayName As Antyvirus,
tblAntivirus.productUpToDate,
tblSoundDevice.Caption As [Audio Card],
tblSoundDevice.Manufacturer As [Audio Card Manufacturer],
tblDiskdrives.Caption,
tblDiskdrives.Description As Partycja,
tblDiskdrives.FileSystem,
tblDiskdrives.Freespace,
tblDiskdrives.Size As [Disk Size]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblOperatingsystem
On tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblNetworkAdapter On tblAssets.AssetID = tblNetworkAdapter.AssetID
Inner Join tblAntivirus On tblAssets.AssetID = tblAntivirus.AssetID
Inner Join tblBaseBoard On tblAssets.AssetID = tblBaseBoard.AssetID
Inner Join tblSoundDevice On tblAssets.AssetID = tblSoundDevice.AssetID
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblDiskPartition On tblAssets.AssetID = tblDiskPartition.AssetID
Where (tsysAssetTypes.AssetTypename = 'Windows' And tblComputersystem.Model != 'VMware Virtual Platform' And tblAntivirus.DisplayName != 'Windows Defender' And tblSoundDevice.Caption != 'Audio dla wyświetlaczy Intel(R)' And tblDiskdrives.FileSystem = 'FAT' And tblAssetCustom.State = 1) Or
(tsysAssetTypes.AssetTypename = 'Windows' And tblComputersystem.Model != 'VMware Virtual Platform' And tblAntivirus.DisplayName != 'Windows Defender' And tblSoundDevice.Caption != 'Audio dla wyświetlaczy Intel(R)' And tblDiskdrives.FileSystem = 'FAT32' And tblAssetCustom.State = 1) Or
(tsysAssetTypes.AssetTypename = 'Windows' And tblComputersystem.Model != 'VMware Virtual Platform' And tblAntivirus.DisplayName != 'Windows Defender' And tblSoundDevice.Caption != 'Audio dla wyświetlaczy Intel(R)' And tblDiskdrives.FileSystem = 'NTFS' And tblAssetCustom.State = 1)
Order By tblAssets.AssetName

View solution in original post

3 REPLIES 3
evan91
Engaged Sweeper
Thx, it works 🙂
KrisNelson
Champion Sweeper
I assuming you want the following:


Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssetCustom.Manufacturer,
tblComputersystem.Model,
tblAssetCustom.Serialnumber As [Service Tag],
tblNetworkAdapter.Manufacturer As [Network Card Manufacturer],
tblNetworkAdapter.Name As [Network Card Name],
tblNetworkAdapter.MACAddress,
tblAssets.IPAddress,
tblAssets.Username,
tblAssets.Domain,
tblAssets.Processor,
tblBaseBoard.Product As Motherboard,
tblAssets.Memory,
tblOperatingsystem.Caption As OS,
tblAssets.Lastseen,
tblAssetCustom.PurchaseDate,
tblAssetCustom.Warrantydate,
tblAntivirus.DisplayName As Antyvirus,
tblAntivirus.productUpToDate,
tblSoundDevice.Caption As [Audio Card],
tblSoundDevice.Manufacturer As [Audio Card Manufacturer],
tblDiskdrives.Caption,
tblDiskdrives.Description As Partycja,
tblDiskdrives.FileSystem,
tblDiskdrives.Freespace,
tblDiskdrives.Size As [Disk Size]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblOperatingsystem
On tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblNetworkAdapter On tblAssets.AssetID = tblNetworkAdapter.AssetID
Inner Join tblAntivirus On tblAssets.AssetID = tblAntivirus.AssetID
Inner Join tblBaseBoard On tblAssets.AssetID = tblBaseBoard.AssetID
Inner Join tblSoundDevice On tblAssets.AssetID = tblSoundDevice.AssetID
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblDiskPartition On tblAssets.AssetID = tblDiskPartition.AssetID
Where (tsysAssetTypes.AssetTypename = 'Windows' And tblComputersystem.Model != 'VMware Virtual Platform' And tblAntivirus.DisplayName != 'Windows Defender' And tblSoundDevice.Caption != 'Audio dla wyświetlaczy Intel(R)' And tblDiskdrives.FileSystem = 'FAT' And tblAssetCustom.State = 1) Or
(tsysAssetTypes.AssetTypename = 'Windows' And tblComputersystem.Model != 'VMware Virtual Platform' And tblAntivirus.DisplayName != 'Windows Defender' And tblSoundDevice.Caption != 'Audio dla wyświetlaczy Intel(R)' And tblDiskdrives.FileSystem = 'FAT32' And tblAssetCustom.State = 1) Or
(tsysAssetTypes.AssetTypename = 'Windows' And tblComputersystem.Model != 'VMware Virtual Platform' And tblAntivirus.DisplayName != 'Windows Defender' And tblSoundDevice.Caption != 'Audio dla wyświetlaczy Intel(R)' And tblDiskdrives.FileSystem = 'NTFS' And tblAssetCustom.State = 1)
Order By tblAssets.AssetName

Esben_D
Lansweeper Employee
Lansweeper Employee
Looks about right, however, do note that the last 2 parts of your where clause will not take anything before it into account because of the OR.

(Where clause 1) Or (tblDiskdrives.FileSystem = 'FAT32') Or (tblDiskdrives.FileSystem = 'NTFS')