Note that the underscore is also a wildcard in SQL/WQL as are what I call character classes (similar to regular expressions).
% means 0 or more of any character _ means 1 of any character More info at http://www.w3schools.com/sql/sql_wildcards.asp J From: [email protected] [mailto:[email protected]] On Behalf Of Kevin Johnston Sent: Friday, August 23, 2013 11:26 AM To: '[email protected]' Subject: RE: [mssms] Creating a membership rule query for a device collection Awesome thanks Ryan!! From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Ryan Sent: Friday, August 23, 2013 12:16 PM To: [email protected]<mailto:[email protected]> Subject: Re: [mssms] Creating a membership rule query for a device collection Wildcards are %. If you use a wildcard, you need to use "like" instead of "=". Here is the query for all devices that start with L: 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 where SMS_R_System.Name like "L%" On Fri, Aug 23, 2013 at 11:10 AM, Kevin Johnston <[email protected]<mailto:[email protected]>> wrote: In CM12 I created Laptop, workstation and server collections. I originally had the membership setup as direct (during testing) and noticed that no new machines are in these collections. We mark all out laptops with the prefix of L and our workstations with W Is there a way to make a query that says anything that starts with L put in the laptop collection and anything that starts with W put in the workstation collection? I am not sure about wildcards... But this is what I have: 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 = "L$" Thanks, Kevin Johnston

