Also, there’s no reason to join with SMS_G_System_COMPUTER_SYSTEM as SMS_R_System already contains the name of the system although your criteria for the subselect should be based on ResourceID and not name as ResourceID is the primary/forign key here.
J From: <listsad...@lists.myitforum.com> on behalf of DonPick <don.l.pick...@gmail.com> Reply-To: "mssms@lists.myitforum.com" <mssms@lists.myitforum.com> Date: Thursday, July 13, 2017 at 4:45 AM To: "mssms@lists.myitforum.com" <mssms@lists.myitforum.com> Subject: RE: [mssms] WQL to get systems without a specific software installed You’re not involving the 64bit ARP? http://smsug.ca/blogs/garth_jones/archive/2012/01/16/wql-query-for-both-x86-and-x64-version-of-software.aspx Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10 From: Haritwal, Dhiraj<mailto:dhiraj.harit...@sony.com> Sent: Thursday, 13 July 2017 6:18 PM To: mssms@lists.myitforum.com<mailto:mssms@lists.myitforum.com> Subject: [mssms] WQL to get systems without a specific software installed Hi, I am using below WQL to get systems without a specific software which looks working for one software & not working for another. What should be the confirmed WQL which should work for all software’s. 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 inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM.Name not in (select distinct SMS_G_System_COMPUTER_SYSTEM.Name from SMS_R_System inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "%Adobe Reader 11%") Dhiraj This email is confidential and intended only for the use of the individual or entity named above and may contain information that is privileged. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or telephone and destroy the original message. - This mail is sent via Sony Asia Pacific Mail Gateway..