→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎10-06-2021 02:32 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysOS.OSname,
tblAssets.Username,
tsysOS.Image As icon,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Description,
Max(Convert(date,tblQuickFixEngineering.InstalledOn)) As lastPatchDate,
tblAssets.Lastseen,
Case
When Max(Convert(date,tblQuickFixEngineering.InstalledOn)) >= DateAdd(day,
-7, GetDate()) Then '#d4f4be'
When Max(Convert(date,tblQuickFixEngineering.InstalledOn)) < DateAdd(day,
-7, GetDate()) And Max(Convert(date,tblQuickFixEngineering.InstalledOn))
>= DateAdd(day, -30, GetDate()) Then '#f7f0ca'
When Max(Convert(date,tblQuickFixEngineering.InstalledOn)) < DateAdd(day,
-31, GetDate()) And Max(Convert(date,tblQuickFixEngineering.InstalledOn))
>= DateAdd(day, -90, GetDate()) Then '#f2d59f'
Else '#f7caca'
End As backgroundcolor,
tblAssets.Lasttried,
tblDomainroles.Domainrolename,
Convert(nvarchar(10),Ceiling(Floor(Convert(integer,tblAssets.Uptime) / 3600 /
24))) + ' days ' +
Convert(nvarchar(10),Ceiling(Floor(Convert(integer,tblAssets.Uptime) / 3600 %
24))) + ' hours ' +
Convert(nvarchar(10),Ceiling(Floor(Convert(integer,tblAssets.Uptime) % 3600 /
60))) + ' minutes' As Uptime
From tblQuickFixEngineering
Join tblAssets On tblAssets.AssetID = tblQuickFixEngineering.AssetID
Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join lansweeperdb.dbo.tblComputersystem On tblAssets.AssetID =
tblComputersystem.AssetID
Inner Join lansweeperdb.dbo.tblDomainroles On tblDomainroles.Domainrole =
tblComputersystem.Domainrole
Where tblDomainroles.Domainrolename In ('Stand-alone server', 'Member server',
'Backup domain controller', 'Primary domain controller') And
tblAssetCustom.State = 1
Group By tblAssets.AssetID,
tblAssets.AssetName,
tsysOS.OSname,
tblAssets.Username,
tsysOS.Image,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Description,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblDomainroles.Domainrolename,
tblAssets.Uptime
Order By lastPatchDate
‎04-24-2023 08:33 PM
Really with LS had this built in as it would be very useful
‎10-13-2021 03:00 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now