Select Distinct Top 1000000 tblAssets.AssetID, tblAssets.AssetName, tblAssets.Domain, tsysAssetTypes.AssetTypename As AssetType, tblAssets.Username, tblAssets.Userdomain, tsysAssetTypes.AssetTypeIcon10 As icon, tblAssets.IPAddress, tsysIPLocations.IPLocation, tblAssetCustom.Manufacturer, tblAssetCustom.Model, tsysOS.OSname As OS, tblAssets.Version As OSVersion, tblAssets.SP, subquery1.Software, subquery1.Version, subquery1.Publisher, subquery1.EOLDate, Case When GetDate() < subquery1.EOLDate Then Cast(DateDiff(DAY, GetDate(), subquery1.EOLDate) As NVARCHAR) + ' days remaining' End As [Days Remaining], tblAssets.Lastseen, tblAssets.Lasttried, Case When GetDate() > subquery1.EOLDate Then '#ffadad' When GetDate() >= DateAdd(month, -1, subquery1.EOLDate) Then '#ffd152' Else '#d4f4be' End As backgroundcolor From tblAssets Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype Inner Join tsysIPLocations On tsysIPLocations.LocationID = tblAssets.LocationID Inner Join tblState On tblState.State = tblAssetCustom.State Left Join tsysOS On tsysOS.OScode = tblAssets.OScode Left Join (Select tblSoftwareUni.softwareName As Software, tblsoftware.softwareVersion As Version, tblSoftwareUni.SoftwarePublisher As Publisher, Case When tblSoftwareUni.softwareName Like '%AppFabric 1.1%' Then '2022-04-12' Else 'EOL' End As EOLDate, tblsoftware.AssetID From tblsoftware Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblsoftware.softID Where tblSoftwareUni.softwareName Like '%AppFabric%' And tblSoftwareUni.SoftwarePublisher Like '%Microsoft%') As subquery1 On subquery1.AssetID = tblAssets.AssetID Where subquery1.Software Like '%AppFabric%' And subquery1.Publisher Like '%Microsoft%' And tblState.Statename = 'Active'
Explore Lansweeper for free.
No credit card required.