07-11-2023 09:13 AM - last edited on 03-31-2024 03:47 PM by Mercedes_O
Hi all,
Just created a new custom report that works fine where if the two conditions are true paint the rows on green and if one of them is not true paint the row red. So at this point, I need to only show on the report the red rows. Is that difficult? This is the code in SQL:
Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName As NOMBRE,
tblAssets.Lastseen As [ULT. VISTO],
tblAssets.Username As [ULT. USUARIO LOGADO],
tblAssetCustom.Custom5 As [USUARIO ASIGNADO],
tblAssetCustom.Custom4 As [FECHA ASIGNACIÓN],
tblAssetCustom.Department As DPTO,
tblAssetCustom.Building As PLANTA,
tsysOS.OSname As OS,
tblAssets.Version As [VERSION OS],
tblBaseBoard.Manufacturer As MARCA,
tblAssetCustom.Model As MODELO,
tblAntivirus.DisplayName As ANTIVIRUS,
tblSoftware.softwareVersion As VERSIÓN,
tblAntivirus.productUpToDate As [¿ACTUALIZADO?],
Case
When tblAssets.Version = '22H2' And tblAntivirus.productUpToDate = 'True'
Then '#d4f4be'
Else '#ffadad'
End As backgroundcolor
From tblAssets
Left Join tblBaseBoard On tblAssets.AssetID = tblBaseBoard.AssetID
Left Join tblProcessor On tblAssets.AssetID = tblProcessor.AssetID
Left Join tblOperatingsystem On tblAssets.AssetID = tblOperatingsystem.AssetID
Left Join tblBIOS On tblAssets.AssetID = tblBIOS.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblPhysicalMemory On tblAssets.AssetID = tblPhysicalMemory.AssetID
Inner Join TsysMemorytypes On tblPhysicalMemory.MemoryType =
TsysMemorytypes.Memorytype
Inner Join tblVideoController On
tblAssets.AssetID = tblVideoController.AssetID
Inner Join tblAntivirus On tblAssets.AssetID = tblAntivirus.AssetID
Inner Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID And
tblAntivirus.AssetID = tblSoftware.AssetID
Where tblAntivirus.DisplayName != 'Windows Defender' And
tblAntivirus.DisplayName != 'ESET Security' And tblSoftware.CatalogSoftwareId
= 741
Order By NOMBRE
Kind regards!!
Solved! Go to Solution.
07-11-2023 01:30 PM
Hi @Mister_Nobody,
I tried your solution and worked well, but I realised that filtering by case I already have, using the color code '#ffadad' as criteria, works exactly the same way and I don't need to create an additional column.
So thank you for the clue. I was very helpful.
Greetings!
07-12-2023 06:33 PM
Nice work @Mister_Nobody and for sharing workaround @borgoncete88
07-11-2023 12:45 PM - edited 07-11-2023 12:46 PM
Case
When tblAssets.Version = '22H2' And tblAntivirus.productUpToDate = 'True'
Then 'no-RED'
Else 'RED'
End As STATUS
Add column and filter by it
07-11-2023 01:30 PM
Hi @Mister_Nobody,
I tried your solution and worked well, but I realised that filtering by case I already have, using the color code '#ffadad' as criteria, works exactly the same way and I don't need to create an additional column.
So thank you for the clue. I was very helpful.
Greetings!
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now