Page 1 of 1

SQL - No agents updates found (today)

Posted: Sat Jan 15, 2022 3:57 pm
by Cubert
No updates found (today)

Code: Select all

SELECT DISTINCT computers.computerid AS 'ID',
     computers.name AS 'Patched today',
     clients.name AS 'Client',
     commands.dateupdated AS 'Completed'
FROM commands JOIN computers ON (commands.computerid =
computers.computerid) JOIN clients ON (computers.clientid =
clients.clientid)
WHERE command = 100 AND `status` = 3
AND output LIKE '%No Updates to Install%'
AND commands.dateupdated >=CURDATE()
GROUP BY computers.name
ORDER BY `Completed` DESC