Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm dazed and confused

Status
Not open for further replies.

Mich

IS-IT--Management
Dec 26, 2000
452
US
OK, I know I should know this, but it just isn't making sense to me.

I'm generating a report using VBScript based off of the following query:

select sys.Netbios_Name0, summ.id, summ.product
CASE WHEN ps.LastState=105 THEN '+' ELSE '-' END as C088
from v_R_System sys join v_GS_PatchStatus ps on sys.ResourceID=ps.ResourceID
join v_ApplicableUpdatesSummary summ on ps.ID=summ.ID and ps.QNumbers=summ.QNumbers and ps.Product=summ.Product and ps.LocaleID=summ.LocaleID and ps.Title=summ.Title
order by sys.netbios_name0, summ.id

The query comes back fine and I can parse the information using my script. Problem is the reported information doesn't seem accurate. The report shows which machines are missing which MS patches, but when I take the report to the machine they show the patch(es) installed. Some will report only one missing patch and when I visit the machine there will be 30 missing AND after I update the one that is listed will not go away.

Does this make any sense? I'm confusing myself even more just typing this out.

-If it ain't broke, break it and make it better.
 
I've never seen so many conditions on a "join on", but that doesn't mean it can't be done .... it's sort of like your "where" statement.

Try this:

select sys.Netbios_Name0, summ.id, summ.product, CASE WHEN ps.LastState=105 THEN '+' ELSE '-' END as C088
from v_R_System sys
join v_GS_PatchStatus ps on sys.ResourceID=ps.ResourceID
join v_ApplicableUpdatesSummary summ on ps.ID=summ.ID
where ps.QNumbers=summ.QNumbers and ps.Product=summ.Product and ps.LocaleID=summ.LocaleID and ps.Title=summ.Title
order by sys.netbios_name0, summ.id

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top