Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

SQL Query not running agains selected source after upgrade

I had a simple SQL Query that ran properly until upgrading from 19.0.40.0 to 19.3.42.0.

When manually selecting the collection source offline systems are still showing up in the results when the collection that is selected should only be showing online systems only,

When I even select a collection that has only 2 systems listed the results still show a list of 30 results.

SELECT

    Computers.Name as "Computer Name",

    Computers.IPAddress AS 'IP Address',

    Computers.CurrentUser AS 'Current User',

    Computers.SimpleReasonForReboot AS 'Reason For Reboot',

    date(Computers.BootTime) AS 'Boot Time'

FROM Computers WHERE SimpleReasonForReboot LIKE 'Windows Updates asked for a reboot%'

ORDER BY Computers.BootTime;

1

Comments

5 comments
Date Votes
  • SQL Reports need to have the following clause in order to work with Select Collection Source:

    WHERE <ComputerFilter>
    1
  • I do have the WHERE clause in the query.

    WHERE Computers.SimpleReasonForReboot LIKE 'Windows Updates asked for a reboot%'

    0
  • You'll have to modify it like this:

    WHERE Computers.SimpleReasonForReboot LIKE 'Windows Updates asked for a reboot%' AND <ComputerFilter>
    1
  • I see the issue. I had to add the AND IsOnline

    SELECT
    Name AS 'Computer Name',
    BootTime,
    IPAddress AS 'IP Address',
    IsOnline, CurrentUser AS 'Current User',
    SimpleReasonForReboot AS 'Reboot Reason'
    FROM Computers
    WHERE SimpleReasonForReboot LIKE 'Windows Updates asked for a reboot%' AND IsOnline
    ORDER BY Computers.Name;

    1
  • Thank you

    1