SQL Report on Computer Collections Not Working
I've got a problem with the SQL Report I'm creating. I'm trying to get a File Inventory report generated and limiting it to a specific collection of Computers. I've tried it a couple of ways but the report includes all of the computers instead of just the computers in the collection. I've tried selecting the "Select Collection Source" option and I've tried using the following SQL:
select Computers.Name,FilePaths.PathName,Files.FileName,Files.Modified,Files.Size,Files.Type FROM Computers LEFT JOIN CollectionComputers ON Computers.ComputerId = CollectionComputers.ComputerId LEFT JOIN Files ON Computers.ComputerId = Files.ComputerId LEFT JOIN FilePaths ON Files.FilePathId = FilePaths.FilePathId WHERE CollectionComputers.CollectionId = 1748 ORDER BY Computers.Name
Nothing seems to limit the report output to the desired collection. What am I doing wrong?
Comments
You dont need define in sql any collections / id-s etc, make generic one and run report directly on collection container, you know, right click and Run Report...
You need to use
WHERE <ComputerFilter>
, a special value that Inventory's reporting engine uses to filter your results by the selected collection. https://documentation.pdq.com/PDQInventory/17.1.0.0/sql-reports.htm#creatingsqlreportAh...enlightenment! Thank you...makes sense...working like a champ!
Thanks a lot!