sqlsccmsccm-2007

My SCCM 2007 SQL Web Report is not displaying results


I created an SCCM SQL report using SQL Management Studio. I then created the following prompts for my Asset Management Office to use on the web report: Publisher, Display Name, and Version.

The Display Name and the Version prompts are both optional.

I receive no syntax errors or anything, but I receive absolutely no results whatsoever when I click on the Display button to produce the web report.

Here is my SQL code:

==================================================================================

SELECT dbo.v_R_System.Netbios_Name0, dbo.v_GS_ADD_REMOVE_PROGRAMS.DisplayName0, dbo.v_GS_ADD_REMOVE_PROGRAMS.Version0, dbo.v_GS_ADD_REMOVE_PROGRAMS.Publisher0

FROM dbo.v_R_System INNER JOIN dbo.v_GS_ADD_REMOVE_PROGRAMS ON dbo.v_R_System.ResourceID = dbo.v_GS_ADD_REMOVE_PROGRAMS.ResourceID

WHERE dbo.v_GS_ADD_REMOVE_PROGRAMS.DisplayName0 = @DisplayName AND dbo.v_GS_ADD_REMOVE_PROGRAMS.Version0 = @Version AND dbo.v_GS_ADD_REMOVE_PROGRAMS.Publisher0 = @Publisher

Order by dbo.v_GS_ADD_REMOVE_PROGRAMS.DisplayName0 ASC

==================================================================================

I run my report and in the Publisher prompt, I type in something like %Autodesk% and then I click the Display button, and absolutely nothing is displayed. I can go to another report and look up Autodesk products, but not this one. I am not a well versed SQL guy, so if anyone can help me that would be great.

Thanks


Solution

  • % signs often mean wildcards. They are used with the like keyword. You have equal signs. In other words,

    where DisplayName like '%fred%'
    

    will return fred, freddie, frederick, etc. However,

    where DisplayName = '%fred%'
    

    will only return %fred%