Last Patched Report for all assets
I found a report on this site that is extremely helpful and was wondering if anyone can help me add a field for Operating System so that we can sort the output by that? Here is the T-SQL for the current report:
SELECT M.NAME, PATCH.TITLE, PMS.STATUS, PMS.STATUS_DT, MAX(PMS.DEPLOY_STATUS_DT) AS "Deploy Date"
FROM ORG2.PATCHLINK_MACHINE_STATUS PMS
JOIN MACHINE M on PMS.MACHINE_ID = M.ID
JOIN KBSYS.PATCHLINK_PATCH PATCH on PATCH.UID = PMS.PATCHUID
WHERE STATUS = "PATCHED"
GROUP BY M.NAME
1 Comment
[ + ] Show comment
Answers (1)
Answer Summary:
Please log in to answer
Posted by:
ondrar
6 years ago
Top Answer
SELECT M.NAME, M.OS_NAME, PATCH.TITLE, PMS.STATUS, PMS.STATUS_DT, MAX(PMS.DEPLOY_STATUS_DT) AS "Deploy Date"
FROM ORG1.PATCHLINK_MACHINE_STATUS PMS
JOIN MACHINE M on PMS.MACHINE_ID = M.ID
JOIN KBSYS.PATCHLINK_PATCH PATCH on PATCH.UID = PMS.PATCHUID
WHERE STATUS = "PATCHED"
GROUP BY M.NAME
I highlighted what you need to add.
Comments:
-
Thank you - patchadams 6 years ago
Is there a way to order the results by deploy date? I added "ORDER BY PMS.DEPLOY_STATUS_DT" at the end, but it doesn't sort on that field correctly. - todd.varde@hwhlaw.com 6 years ago