|
jnelson993 -> RE: Collection based on NOT having file, with version (9/25/2008 12:30:07 PM)
|
Actually, that won't work as expected. SQL and WQL are going to use a letter-by-letter dictionary sort so version 8 is going to be GREATER than version 11 because the character 8 comes AFTER character 1 in the dictionary. You'll likely have to use a LIKE statement and the bracket wildcard [] operator to catch all the versions from 0-7. And you don't need a subselect, because you're looking for computers that HAVE the file where it's less than version 8.%. So, something like this perhaps: SELECT sys.ResourceID, sys.ResourceType, sys.Name, sys.SMSUniqueIdentifier, sys.ResourceDomainORWorkgroup, sys.Client FROM SMS_R_System AS sys INNER JOIN SMS_G_System_SoftwareFile AS sf ON sys.resourceID = sf.resourceID WHERE sf.FileName = "FileNameHere" AND sf.FileVersion LIKE "[0-7].%" So, if the FileVersion starts with "0." through "7." , it will show up in the report...Make sense? For completeness, let's quickly talk about wildcards...a wildcard character you're probably all familiar with is the % sign. It basically means match 0 or more of any characters. Then there's the underscore _ which means match any single character. But there's also these brackets [ ] which let you specify a range (where [0-9] means a single character matching the number 0 through 9 or [a-g] means a single character matching any letter from a through g) or a set (where [135] means a single character matching a 1, 3 or 5 and [adf] means any single character matching a, d or f). You can also put those brackets next to each other to specify multiple ranges (like [0-9][0-9] representing every number between 00 and 99].
|
|
|
|