AS SELECT DISTINCT TOP 100 PERCENT Paths.PathStr AS [Source Name], ProgramTypes.ProgramType AS [Source Type]
FROM ((StatementReference INNER JOIN OccurrencesStmt ON StatementReference.OccurID = OccurrencesStmt.OccurID) 
INNER JOIN Paths ON OccurrencesStmt.PathID = Paths.PathID) INNER JOIN (ProgramTypes INNER JOIN Programs ON ProgramTypes.ProgramTypeID = Programs.ProgramTypeID) ON OccurrencesStmt.ProgID = Programs.ProgramID
WHERE ( StatementReference.ResourceID IN (select ProgramID from #numeric_param_temp) )
		AND ( StatementReference.ResourceType=4 OR StatementReference.ResourceType=97 )
		AND StatementReference.StatementType > 185 AND StatementReference.StatementType < 227 
ORDER BY Paths.PathStr;
