Here's what I've been using but I haven't perfected it yet. But it has helped me. Just need to change the table referenced throughout the query to reference the correct add and remove programs table you would like or are trying to use.
DECLARE @v1_Application nvarchar(max)
SET @v1_Application = N'%Application%'
DECLARE @v2_Computer nvarchar(max)
SET @v2_Computer = N'%Computer%'
DECLARE @v3_TrusteeScope nvarchar(max)
SET @v3_TrusteeScope = N'%TrusteeScope%'
SELECT
[vri4_Computer].[Guid] AS [_ItemGuid],
[vri4_Computer].[Name] AS [Computer],
[dca5_AddRemoveProgram].[DisplayName] AS [Application],
[dca5_AddRemoveProgram].[DisplayVersion] AS [Version],
[vasset].[status]
FROM
[vRM_Computer_Item] AS [vri4_Computer]
LEFT OUTER JOIN [Inv_AddRemoveProgram] AS [dca5_AddRemoveProgram]
ON ([vri4_Computer].[Guid] = [dca5_AddRemoveProgram].[_ResourceGuid])
Left Outer Join [vasset] ON ([vri4_Computer].[Guid] = [vasset].[_ResourceGuid])
Where [dca5_AddRemoveProgram].[DisplayName] LIKE N'%Application%' AND [vri4_Computer].[Name] LIKE N'%Computer%' AND [vri4_Computer].[IsManaged] LIKE '1' and [vasset].[status] LIKE 'Active'
Order by
[dca5_AddRemoveProgram].[DisplayName],
[dca5_AddRemoveProgram].[DisplayVersion]
Hope this helps,
Misty