The easiest way to do this is just to use reports rather than queries. There are built-in reports that will tell you all the machines with a particular version of a particular product installed. Have a look at the reports in the "Software - Companies and Products" category, like "Computers with a specific product name and version".
If however you actually do need a query, if for instance, you need to create a collection of all of these that you can advertise a specific software package to, then the easiest way is to search for a particular file that will be common to all of these machines.
For example, if you know that the install packages used in your company always install Outlook as part of Office, you could use a query like this that looks for the Outlook EXE file, and checks its version.
For example by setting these criteria in a query:
Software Files.File Name is equal to "outlook.exe"
and
Software Files.File Version is greater than or equal to "11.0.8173.0"
Or this is the query language that the above translates into (this can be pasted into the Show Query Language box):
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_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId
where SMS_G_System_SoftwareFile.FileName = "outlook.exe"
and SMS_G_System_SoftwareFile.FileVersion >= "11.0.8173.0"
For info, file versions for various Office versions and service packs can be found in these Technet pages:
This worked for me:
select SMS_R_System.Name, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
from SMS_R_System
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 "%Visio Standard%"
or SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "%Visio Professional%"
order by SMS_R_System.Name
Best Answer
By the way, for future reference, SCCM version 4.00.6487.2000 is SCCM 2007 Service Pack 2 (SP2). Anyway, to get back to your initial question, copy and paste the following query code into the Query Language section of a new query and name the new query something like "All Systems Running Office 2003":
Then, click on the query, and you should see all systems that are running Office 2003. Then, if you are satisified with this, you can simply create a collection if you really want to by linking this query with your new collection so you don't have to recreate the query again. However, if you just want to display which systems are still running Office 2003, then this query should work for you. If a manager or someone needs a report showing which systems are still running it you can export the findings to a .csv file in Excel and mail that to them.
If you have any issues, let me know.