Cool story bro! :D
The problem with the query is that there can be multiple ProdID's for the same 
DisplayName0, Publisher0, Version0 returned. So it counts them all, skewing the 
expected result. I fixed this by changing Count(ProdID0) to Count(Distinct 
arp.ResourceID)...
SELECT DisplayName0, Count(Distinct arp.ResourceID) AS 'Count', Publisher0, 
Version0, @CollID as CollectionID FROM fn_rbac_Add_Remove_Programs(@UserSIDs)  
arp JOIN fn_rbac_FullCollectionMembership(@UserSIDs)  fcm on 
arp.ResourceID=fcm.ResourceID WHERE ((Publisher0 like @softwarenamefilter) OR 
(DisplayName0 like @softwarenamefilter) ) and fcm.CollectionID=@CollID GROUP BY 
DisplayName0, Publisher0, Version0  ORDER BY Publisher0, Version0
From: [email protected]
To: [email protected]
Subject: RE: [mssms] Report No Bueno: Count of instances of specific software 
registered with Add or Remove Programs
Date: Wed, 30 Oct 2013 14:17:36 +0000









Floating point error? #PentiumRox
 
-Phil
 
_________________________________________________________________
Phil Schwan |
 Technical Specialist, Enterprise Windows Services
Project Leadership Associates
|
2000 Town Center, Suite 1900, Southfield, MI 48075
Lync: 312.756.1626  Mobile: 419.262.5133
www.projectleadership.net
Lead
 with Strategy. Leverage Technology. Deliver Results.
 
 
 
 


From: [email protected] [mailto:[email protected]]
On Behalf Of Stephen Leuthold

Sent: Wednesday, October 30, 2013 10:05 AM

To: [email protected]

Subject: [mssms] Report No Bueno: Count of instances of specific software 
registered with Add or Remove Programs


 


SC2012SP1 CM CU2 environment...


 

This may be old news but does anyone else notice the counts are off (sometimes 
WAY off) when running this report?


 


-Stephen


 






PRIVILEGED AND CONFIDENTIAL. This email and any files transmitted with it are 
privileged and confidential and intended solely for the use of the individual 
or entity to whom they are addressed. If you have received this email in error 
please notify the sender.
 If you are not the named addressee you should not disseminate, distribute or 
copy this e-mail or any of its attachments.
 






                                          


<<inline: image001.jpg>>

<<inline: image002.jpg>>

<<inline: image003.jpg>>

<<inline: image004.jpg>>

Reply via email to