myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


Problem with PatchState report pulling system name and username

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> Microsoft Systems Management Server >> Web Reporting >> Problem with PatchState report pulling system name and username Page: [1]
Login
Message << Older Topic   Newer Topic >>
Problem with PatchState report pulling system name and ... - 8/13/2008 1:09:36 PM   
jscott607

 

Posts: 210
Score: 0
Joined: 9/20/2005
Status: offline
Hello. I am having problems getting a web report to pull up what I need. The report is suppose to display the details of a patch listing it as either applicable or installed with the system name and user name.

If I remove the name and user name, it displays the counts. I assume my problem is with how I am using SUM. However, I have tried quite a few different ways of pulling the information and I cannot figure it out.

Any assistance would be greatly appreciated.

SELECT     sys.Name0 AS [System Name], sys.User_Name0 AS [User Name], pse.Title0 AS Description, pse.ID0 AS [Update ID], rl.Country,
                     SUM(CASE WHEN pse.status0 = 'INSTALLED' THEN 1 END) AS Installed,
                     SUM(CASE WHEN pse.status0 = 'APPLICABLE' THEN 1 END) AS Applicable
FROM         v_GS_PATCHSTATEEX AS pse INNER JOIN
                     v_R_System AS sys ON pse.ResourceID = sys.ResourceID INNER JOIN
                     v_ApplicableUpdatesSummaryEx ON pse.UpdateID0 = v_ApplicableUpdatesSummaryEx.UniqueUpdateID INNER JOIN
                     Regional_Location AS rl ON sys.AD_Site_Name0 = rl.AdSite
WHERE     (v_ApplicableUpdatesSummaryEx.ScanAgent = 'Microsoft Updates Tool') AND (v_ApplicableUpdatesSummaryEx.ID LIKE 'MS0%') AND
                     (v_ApplicableUpdatesSummaryEx.TimeAuthorized IS NOT NULL) AND (v_ApplicableUpdatesSummaryEx.InstalledCounts <> 0) AND
                     (pse.ID0 LIKE 'MS%') AND (rl.Country = @country) AND (pse.Title0 = @title)
GROUP BY pse.ID0, pse.Title0, rl.Country, sys.Name0, sys.User_Name0
HAVING      (COUNT(*) > 10)
ORDER BY [Update ID], Description
Post #: 1
RE: Problem with PatchState report pulling system name ... - 8/13/2008 6:59:33 PM   
jnelson993


Posts: 900
Score: 127
Joined: 2/18/2005
From: Minneapolis, MN
Status: offline
Hey, that thing was working when I gave it to you :)

Seriously though, the problem is in the HAVING clause.  You're grouping by computername and username (as is normal for a detail report) but you're looking for counts of machines by MSID (as is normal for a summary report).  You won't be able to do it that way.

What if you used the InstalledCounts field?

Change
        AND (v_ApplicableUpdatesSummaryEx.InstalledCounts <> 0)
to
        AND (v_ApplicableUpdatesSummaryEx.InstalledCounts > 10)



_____________________________

Number2 (John Nelson)
MyITForum - Blog
MyITForum - Forum Posts

(in reply to jscott607)
Post #: 2
RE: Problem with PatchState report pulling system name ... - 8/14/2008 8:40:00 AM   
jscott607

 

Posts: 210
Score: 0
Joined: 9/20/2005
Status: offline
Management keeps asking for new results. I appreciate your assistance.

I decided to only output the systems where a patch is applicable. Below is what I am using.

SELECT     v_R_System.Name0 AS [System Name], v_R_System.User_Name0 AS [User Name], Regional_Location.Country, v_GS_PATCHSTATEEX.ID0 AS ID,
                     v_GS_PATCHSTATEEX.Title0 AS Title
FROM         v_GS_PATCHSTATEEX INNER JOIN
                     v_R_System ON v_GS_PATCHSTATEEX.ResourceID = v_R_System.ResourceID INNER JOIN
                     Regional_Location ON v_R_System.AD_Site_Name0 = Regional_Location.AdSite
WHERE     (Regional_Location.Country = @country) AND (v_GS_PATCHSTATEEX.Status0 = 'Applicable') AND (v_GS_PATCHSTATEEX.Title0 = @title)
ORDER BY [System Name]

(in reply to jnelson993)
Post #: 3
RE: Problem with PatchState report pulling system name ... - 8/14/2008 8:49:44 AM   
gjones


Posts: 824
Score: 50
Joined: 6/5/2001
From: Ottawa, Ontario, Canada
Status: offline
So what is wrong with this report?

_____________________________

Garth@enhansoft.com

For a List of my Articles
http://www.myitforum.com/contrib/default.asp?cid=116
Blogs:
http://smsug.ca/blogs/garth_jones/default.aspx
http://myitforum.com/cs2/blogs/gjones/default.aspx


(in reply to jscott607)
Post #: 4
Page:   [1]
All Forums >> [Management Products] >> Microsoft Systems Management Server >> Web Reporting >> Problem with PatchState report pulling system name and username Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.234