cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
DontByteMe
Engaged Sweeper III
Select Top 1000000 tblAssets.AssetID,
tblADusers.Lastname,
tblADusers.Firstname,
tblAssets.AssetUnique,
tblAssets.Domain,
tblSoftwareUni.softwareName As Software,
tblSoftware.softwareVersion As Version,
Case tblSoftware.softwareVersion
When '20.2.11.3' Then '2-Current-20.2.1'
When '20.0.0.377' Then '0-Original'
When '20.0.1.2' Then '0A-Original'
When '20.1.0.81' Then '1-20.1'
When '20.2.0.48' Then '2-20.2'
Else 'Unknown'
End As [Service Pack],
tblSoftwareUni.SoftwarePublisher As Autodesk,
tsysOS.Image As icon,
tsysOS.OSname,
tblSoftware.softID As softid,
tblAssets.IPAddress,
tblAssets.IPNumeric
From tblSoftware
Inner Join tblAssets On tblSoftware.AssetID = tblAssets.AssetID
Inner Join tblSoftwareUni On tblSoftware.softID = tblSoftwareUni.SoftID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblADusers On tblADusers.Username = tblAssets.Username
Where tblSoftwareUni.softwareName Like 'Autodesk Revit 2020' And
tblAssetCustom.State = 1 And tblSoftwareUni.SoftID = 2521
Order By [Service Pack],
tblAssets.AssetName,
Version


The above is the code. I have been playing around and have not come up with what I have been wanting. I have tried the following

Adding

Case
When '2-Current-20.2.1' then '#d4f4be'
Else '#ffadad'
End As backgroundcolor


I have tried just adding the colors to the case above with still nothing changing color. I was trying to mimic the process from a google vulnerability report but again no avail. Please help me out. My other reports are like the first portion.
1 ACCEPTED SOLUTION
KrisNelson
Champion Sweeper
Just add it in twice; Here is code that 'should' work.

Select Top 1000000 tblAssets.AssetID,
tblADusers.Lastname,
tblADusers.Firstname,
tblAssets.AssetUnique,
tblAssets.Domain,
tblSoftwareUni.softwareName As Software,
tblSoftware.softwareVersion As Version,
Case tblSoftware.softwareVersion
When '20.2.11.3' Then '2-Current-20.2.1'
When '20.0.0.377' Then '0-Original'
When '20.0.1.2' Then '0A-Original'
When '20.1.0.81' Then '1-20.1'
When '20.2.0.48' Then '2-20.2'
Else 'Unknown'
End As [Service Pack],
Case tblSoftware.softwareVersion
When '20.2.11.3' then '#d4f4be'
Else '#ffadad'
End As backgroundcolor,
tblSoftwareUni.SoftwarePublisher As Autodesk,
tsysOS.Image As icon,
tsysOS.OSname,
tblSoftware.softID As softid,
tblAssets.IPAddress,
tblAssets.IPNumeric
From tblSoftware
Inner Join tblAssets On tblSoftware.AssetID = tblAssets.AssetID
Inner Join tblSoftwareUni On tblSoftware.softID = tblSoftwareUni.SoftID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblADusers On tblADusers.Username = tblAssets.Username
Where tblSoftwareUni.softwareName Like 'Autodesk Revit 2020' And
tblAssetCustom.State = 1 And tblSoftwareUni.SoftID = 2521
Order By [Service Pack],
tblAssets.AssetName,
Version

View solution in original post

4 REPLIES 4
KrisNelson
Champion Sweeper
Just add it in twice; Here is code that 'should' work.

Select Top 1000000 tblAssets.AssetID,
tblADusers.Lastname,
tblADusers.Firstname,
tblAssets.AssetUnique,
tblAssets.Domain,
tblSoftwareUni.softwareName As Software,
tblSoftware.softwareVersion As Version,
Case tblSoftware.softwareVersion
When '20.2.11.3' Then '2-Current-20.2.1'
When '20.0.0.377' Then '0-Original'
When '20.0.1.2' Then '0A-Original'
When '20.1.0.81' Then '1-20.1'
When '20.2.0.48' Then '2-20.2'
Else 'Unknown'
End As [Service Pack],
Case tblSoftware.softwareVersion
When '20.2.11.3' then '#d4f4be'
Else '#ffadad'
End As backgroundcolor,
tblSoftwareUni.SoftwarePublisher As Autodesk,
tsysOS.Image As icon,
tsysOS.OSname,
tblSoftware.softID As softid,
tblAssets.IPAddress,
tblAssets.IPNumeric
From tblSoftware
Inner Join tblAssets On tblSoftware.AssetID = tblAssets.AssetID
Inner Join tblSoftwareUni On tblSoftware.softID = tblSoftwareUni.SoftID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblADusers On tblADusers.Username = tblAssets.Username
Where tblSoftwareUni.softwareName Like 'Autodesk Revit 2020' And
tblAssetCustom.State = 1 And tblSoftwareUni.SoftID = 2521
Order By [Service Pack],
tblAssets.AssetName,
Version
KrisNelson wrote:
Just add it in twice; Here is code that 'should' work.

Select Top 1000000 tblAssets.AssetID,
tblADusers.Lastname,
tblADusers.Firstname,
tblAssets.AssetUnique,
tblAssets.Domain,
tblSoftwareUni.softwareName As Software,
tblSoftware.softwareVersion As Version,
Case tblSoftware.softwareVersion
When '20.2.11.3' Then '2-Current-20.2.1'
When '20.0.0.377' Then '0-Original'
When '20.0.1.2' Then '0A-Original'
When '20.1.0.81' Then '1-20.1'
When '20.2.0.48' Then '2-20.2'
Else 'Unknown'
End As [Service Pack],
Case tblSoftware.softwareVersion
When '20.2.11.3' then '#d4f4be'
Else '#ffadad'
End As backgroundcolor,
tblSoftwareUni.SoftwarePublisher As Autodesk,
tsysOS.Image As icon,
tsysOS.OSname,
tblSoftware.softID As softid,
tblAssets.IPAddress,
tblAssets.IPNumeric
From tblSoftware
Inner Join tblAssets On tblSoftware.AssetID = tblAssets.AssetID
Inner Join tblSoftwareUni On tblSoftware.softID = tblSoftwareUni.SoftID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblADusers On tblADusers.Username = tblAssets.Username
Where tblSoftwareUni.softwareName Like 'Autodesk Revit 2020' And
tblAssetCustom.State = 1 And tblSoftwareUni.SoftID = 2521
Order By [Service Pack],
tblAssets.AssetName,
Version


i cannot believe that actually worked. The one thing i haven't tried because I didn't realize you could make another of the same case. Awesome I am satisfied with that result.
KrisNelson
Champion Sweeper
There is 2 probable issues here; and they are probably both in play.

First, your Case code for the backgroundcolor isn't specifying a table.field to check. (If everything is showing up pink\light red, I could be wrong here)

Second, the value you are looking for won't exist in any table since you are merely replacing it for the display of the report. Meaning you need to check for '20.2.11.3' in order to see what you think is '2-Current-20.2.1'.

-Kris
KrisNelson wrote:
There is 2 probable issues here; and they are probably both in play.

First, your Case code for the backgroundcolor isn't specifying a table.field to check. (If everything is showing up pink\light red, I could be wrong here)

Second, the value you are looking for won't exist in any table since you are merely replacing it for the display of the report. Meaning you need to check for '20.2.11.3' in order to see what you think is '2-Current-20.2.1'.

-Kris


Is there a way to add two statements? Such as When '20.2.11.3' Then '2-Current-20.2.1' AND '#d4f4be' ???
I was looking around if there was a way to add two things to one statement but was unable. I also noticed my code has a table called Software Version and that table creates another column Service Pack is there a way to then make another table or case stating When Service Pack is 20.2.11.3 then '#d4f4be'?