→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎01-17-2017 04:10 PM
SELECT tblAssets.AssetID, tblAssets.AssetName, tsysOS.OSname, tblAssets.Username, tblAssets.IPAddress, tblAssets.Description,
MAX(CONVERT(datetime, InstalledOn)) as lastPatchDate,
tblAssets.Lastseen
FROM tblQuickFixEngineering
JOIN tblAssets on tblAssets.AssetID=tblQuickFixEngineering.AssetID
join tsysOS on tblAssets.OScode = tsysOS.OScode
Group by tblAssets.AssetID, tblAssets.AssetName, tsysOS.OSname, tblAssets.Username, tblAssets.IPAddress, tblAssets.Description,
tblAssets.Lastseen
Select Case
When PREVIOUSLYCREATEDREPORTNAME.lastPatchDate >= DateAdd(day, -7,
GetDate()) Then '1. less than a week'
When PREVIOUSLYCREATEDREPORTNAME.lastPatchDate < DateAdd(day, -7,
GetDate()) And PREVIOUSLYCREATEDREPORTNAME.lastPatchDate >= DateAdd(day,
-30, GetDate()) Then '2. less than a month'
When PREVIOUSLYCREATEDREPORTNAME.lastPatchDate < DateAdd(day, -31,
GetDate()) And PREVIOUSLYCREATEDREPORTNAME.lastPatchDate >= DateAdd(day,
-90, GetDate()) Then '3. less than 3 months' Else '4. more than 3 months'
End As DateRange,
count(*) As NumberOfAssets
From PREVIOUSLYCREATEDREPORTNAME
Where PREVIOUSLYCREATEDREPORTNAME.OSname In ('Win 7', 'Win 8', 'Win 8.1',
'Win 10')
Group By Case
When PREVIOUSLYCREATEDREPORTNAME.lastPatchDate >= DateAdd(day, -7,
GetDate()) Then '1. less than a week'
When PREVIOUSLYCREATEDREPORTNAME.lastPatchDate < DateAdd(day, -7,
GetDate()) And PREVIOUSLYCREATEDREPORTNAME.lastPatchDate >= DateAdd(day,
-30, GetDate()) Then '2. less than a month'
When PREVIOUSLYCREATEDREPORTNAME.lastPatchDate < DateAdd(day, -31,
GetDate()) And PREVIOUSLYCREATEDREPORTNAME.lastPatchDate >= DateAdd(day,
-90, GetDate()) Then '3. less than 3 months' Else '4. more than 3 months'
End
‎04-08-2022 03:26 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tsysOS.OSname As OS,
tblAssets.Domain,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssetCustom.Custom19 As [WU Class],
Max(Convert(datetime,tblQuickFixEngineering.InstalledOn)) As lastPatchDate,
DateDiff(day, Max(Convert(datetime,tblQuickFixEngineering.InstalledOn)),
GetDate()) As [WU Age in Days],
tblAssets.Lastseen,
Case
When tblAssetCustom.Custom19 = 'Yearly' And
DateDiff(day, Max(Convert(datetime,tblQuickFixEngineering.InstalledOn)),
GetDate()) >= 365 Then 'Not Compliant'
When tblAssetCustom.Custom19 = 'Monthly' And
DateDiff(day, Max(Convert(datetime,tblQuickFixEngineering.InstalledOn)),
GetDate()) >= 60 Then 'Not Compliant'
Else 'Compliant'
End As Status,
Case
When tblAssetCustom.Custom19 = 'Yearly' And
DateDiff(day, Max(Convert(datetime,tblQuickFixEngineering.InstalledOn)),
GetDate()) >= 365 Then '#FFCCCC'
When tblAssetCustom.Custom19 = 'Monthly' And
DateDiff(day, Max(Convert(datetime,tblQuickFixEngineering.InstalledOn)),
GetDate()) >= 60 Then '#FFCCCC'
Else '#CCFFCC'
End As backgroundcolor
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Join tblQuickFixEngineering On
tblAssets.AssetID = tblQuickFixEngineering.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Outer Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Join tblComputerSystem on tblComputerSystem.AssetID = tblAssets.AssetID
Where tblAssets.AssetType = -1 AND tblComputerSystem.DomainRole > 1 -- servers only, change scope if required
Group By tblAssets.AssetID,
tblAssets.AssetUnique,
tblAssets.AssetName,
tsysOS.OSname,
tblAssets.Domain,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssetCustom.Custom19,
tblAssets.Lastseen
‎07-02-2021 04:23 AM
‎03-31-2021 04:43 PM
‎07-01-2021 02:01 PM
Alex Wong wrote:
Dear All, This is a very good report. Is there anyway can add 1 more info where showing the KB release month of KBs installed?
example: Win 10 PC install KB4601319, will show KB release month February 2021.
AssetName | OSName | UserName | IPAddress | LastPatchDate | LastSeen | ***KB release month
Appreciate your assistance to guide on this query.
Thanks.
‎11-24-2020 03:39 PM
‎09-25-2018 10:23 AM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysOS.OSname,
tblAssets.Username,
tblAssets.IPAddress,
tblAssets.Description,
Max(Convert(datetime,tblQuickFixEngineering.InstalledOn)) As lastPatchDate,
tblAssets.Lastseen,
Case
When Max(Convert(datetime,tblQuickFixEngineering.InstalledOn)) >=
DateAdd(day, -7, GetDate()) Then '#d4f4be'
When Max(Convert(datetime,tblQuickFixEngineering.InstalledOn)) <
DateAdd(day, -7, GetDate()) And
Max(Convert(datetime,tblQuickFixEngineering.InstalledOn)) >= DateAdd(day,
-30, GetDate()) Then '#f7f0ca'
When Max(Convert(datetime,tblQuickFixEngineering.InstalledOn)) <
DateAdd(day, -31, GetDate()) And
Max(Convert(datetime,tblQuickFixEngineering.InstalledOn)) >= DateAdd(day,
-90, GetDate()) Then '#f2d59f'
Else '#f7caca'
End As backgroundcolor
From tblQuickFixEngineering
Join tblAssets On tblAssets.AssetID = tblQuickFixEngineering.AssetID
Join tsysOS On tblAssets.OScode = tsysOS.OScode
Group By tblAssets.AssetID,
tblAssets.AssetName,
tsysOS.OSname,
tblAssets.Username,
tblAssets.IPAddress,
tblAssets.Description,
tblAssets.Lastseen
Order By lastPatchDate
‎03-17-2018 02:17 PM
‎04-24-2018 09:16 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysOS.OSname,
tblAssets.Username,
tblAssets.IPAddress,
tblAssets.Description,
Max(Convert(date,tblQuickFixEngineering.InstalledOn)) As lastPatchDate,
tblAssets.Lastseen
From tblQuickFixEngineering
Join tblAssets On tblAssets.AssetID = tblQuickFixEngineering.AssetID
Join tsysOS On tblAssets.OScode = tsysOS.OScode
Where IsDate(tblQuickFixEngineering.InstalledOn) = 1 And
tsysOS.OSname Not In ('Win 7', 'Win XP', 'Win 8', 'Win 8.1', 'Win 10')
Group By tblAssets.AssetID,
tblAssets.AssetName,
tsysOS.OSname,
tblAssets.Username,
tblAssets.IPAddress,
tblAssets.Description,
tblAssets.Lastseen
Having Max(Convert(date,tblQuickFixEngineering.InstalledOn)) < GetDate() - 90
Order By lastPatchDate Desc
‎03-05-2018 11:26 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now