First off, good effort for trying, it's a good way of learning SQL.
You will have to make sure all your tables are linked in your query. I noticed that tblServicesUni wasn't linked to anything. Therefore I added tblServices which is how you can link the name of the service to the ID of the service and as a result the asset it is running on.
Since your current criteria shows all services but "VIPRE Edge Protection", you will receive a row for every service on the asset which doesn't have that caption. You can add the DISTINCT function at the top of the query. Distinct will only show unique rows, since you still have a row for each service caption, if you have a lot of duplicate rows, the DISTINCT function will make sure you only have 1 row per asset.
Lastly, If you are interested in building or modifying reports, I do also recommend:
- Reviewing some SQL tutorials, as the Lansweeper report builder is a standard SQL editor. If you know SQL, you know how to build Lansweeper reports as well. This seems like a good tutorial: https://www.w3schools.com/sql/
- Making use of our database dictionary, which explains in great detail what each database table and field stores. More information on the dictionary can be found here: https://www.lansweeper.com/Forum/yaf_postst9870_Lansweeper-database-dictionary.aspx#post38296
Revised report from below: Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblServices On tblAssets.AssetID = tblServices.AssetID
Inner Join tblServicesUni On tblServicesUni.ServiceuniqueID =
tblServices.ServiceuniqueID
Where tblAssets.AssetID Not In (Select Top 1000000 tblAssets.AssetID
From tblAssets Inner Join tblServices On tblAssets.AssetID =
tblServices.AssetID Inner Join tblServicesUni
On tblServicesUni.ServiceuniqueID = tblServices.ServiceuniqueID
Where tblServicesUni.Caption = 'VIPRE Edge Protection')