Creating a collection group that only add devices that are missing an application
So lets say i need the collection to only add devices that missing an application that is called bigchungs. Im trying to query for the application by looking into a specific file name (the application im querying for doesnt show up on add remove program list on end users devices hence im looking at a certain executable instead) When i ran this statments it added all the machines that already have the application installed which the opposite of that what i want. Here is my query statement, what did i do wrong?
SELECT SMS_R_System.ResourceID, SMS_R_System.ResourceType, SMS_R_System.Name, SMS_R_System.SMSUniqueIdentifier, SMS_R_System.ResourceDomainORWorkgroup, SMS_R_System.Client FROM SMS_R_System JOIN SMS_G_System_SoftwareFile ON SMS_R_System.ResourceID = SMS_G_System_SoftwareFile.ResourceID WHERE SMS_R_System.Client = 1 AND SMS_R_System.Active = 1 AND SMS_G_System_SoftwareFile.FileName = bigchungs.exe' AND SMS_G_System_SoftwareFile.FilePath ='C:\bigchungs\bigchungs.exe'