Jump to content


  • 0
mike

Variable Report

Question

Hello,

Can someone assist me with modifing SCCM Report ID 66? The statement for Report ID 66 is:

Select SYS.Netbios_Name0, SYS.User_Name0, SP.ProductName, SP.CompanyName, SP.ProductVersion

FROM v_GS_SoftwareProduct SP

JOIN v_R_System SYS on SP.ResourceID = SYS.ResourceID

WHERE SP.ProductName = @variable AND SP.ProductVersion = @variable1

Order by SP.ProductName, SP.ProductVersion

 

I want to add the computer's serial number into this statement. This is what I have:

SELECT

v_R_System.Netbios_Name0,

v_GS_PC_BIOS.SerialNumber0,

v_R_System.User_Name0,

v_SoftwareProduct.ProductName,

v_SoftwareProduct.ProductVersion,

v_SoftwareProduct.CompanyName

FROM

v_R_System,

v_GS_PC_BIOS,

v_SoftwareProduct

JOIN I get errors here as well becuase of the "="

v_R_System.ResourceID = v_GS_SoftwareProduct.ResourceID AND

v_R_System.ResourceID = v_GS_PC_BIOS.ResourceID AND

v_GS_SoftwareProduct.ProductID = v_SoftwareProduct.ProductID

WHERE

v_SoftwareProduct.ProductName = @variable (I get Errors here because of the '@' sign)

ORDER BY

v_SoftwareProduct.ProductName, v_SoftwareProduct.ProductVersion

 

Can someone help out on why my errors are occurring? I have also trired different JOIN and FROM variations, but always encounter errors.

 

Thanks,

Mike

 

I made changes afer reviewing the above statement:

SELECT

v_R_System.Netbios_Name0,

v_GS_PC_BIOS.SerialNumber0,

v_R_System.User_Name0,

v_GS_SoftwareProduct.ProductName,

v_GS_SoftwareProduct.ProductVersion,

v_GS_SoftwareProduct.CompanyName

FROM

v_R_System,

v_GS_PC_BIOS,

v_GS_SoftwareProduct

JOIN v_R_System ON

v_R_System.ResourceID = v_GS_SoftwareProduct.ResourceID AND v_R_System.ResourceID = v_GS_PC_BIOS.ResourceID

WHERE

v_GS_SoftwareProduct.ProductName = @variable

ORDER BY

v_GS_SoftwareProduct.ProductName, v_GS_SoftwareProduct.ProductVersion

 

But now I get the following error:

An error occurred when the report was run. The details are as follows:

The multi-part identifier "v_GS_PC_BIOS.ResourceID" could not be bound.

Error Number: -2147217900

Source: Microsoft OLE DB Provider for SQL Server

Native Error: 4104

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hello,

Can someone assist me with modifing SCCM Report ID 66? The statement for Report ID 66 is:

Select SYS.Netbios_Name0, SYS.User_Name0, SP.ProductName, SP.CompanyName, SP.ProductVersion

FROM v_GS_SoftwareProduct SP

JOIN v_R_System SYS on SP.ResourceID = SYS.ResourceID

WHERE SP.ProductName = @variable AND SP.ProductVersion = @variable1

Order by SP.ProductName, SP.ProductVersion

 

I want to add the computer's serial number into this statement. This is what I have:

SELECT

v_R_System.Netbios_Name0,

v_GS_PC_BIOS.SerialNumber0,

v_R_System.User_Name0,

v_SoftwareProduct.ProductName,

v_SoftwareProduct.ProductVersion,

v_SoftwareProduct.CompanyName

FROM

v_R_System,

v_GS_PC_BIOS,

v_SoftwareProduct

JOIN I get errors here as well becuase of the "="

v_R_System.ResourceID = v_GS_SoftwareProduct.ResourceID AND

v_R_System.ResourceID = v_GS_PC_BIOS.ResourceID AND

v_GS_SoftwareProduct.ProductID = v_SoftwareProduct.ProductID

WHERE

v_SoftwareProduct.ProductName = @variable (I get Errors here because of the '@' sign)

ORDER BY

v_SoftwareProduct.ProductName, v_SoftwareProduct.ProductVersion

 

Can someone help out on why my errors are occurring? I have also trired different JOIN and FROM variations, but always encounter errors.

 

Thanks,

Mike

 

I made changes afer reviewing the above statement:

SELECT

v_R_System.Netbios_Name0,

v_GS_PC_BIOS.SerialNumber0,

v_R_System.User_Name0,

v_GS_SoftwareProduct.ProductName,

v_GS_SoftwareProduct.ProductVersion,

v_GS_SoftwareProduct.CompanyName

FROM

v_R_System,

v_GS_PC_BIOS,

v_GS_SoftwareProduct

JOIN v_R_System ON

v_R_System.ResourceID = v_GS_SoftwareProduct.ResourceID AND v_R_System.ResourceID = v_GS_PC_BIOS.ResourceID

WHERE

v_GS_SoftwareProduct.ProductName = @variable

ORDER BY

v_GS_SoftwareProduct.ProductName, v_GS_SoftwareProduct.ProductVersion

 

But now I get the following error:

An error occurred when the report was run. The details are as follows:

The multi-part identifier "v_GS_PC_BIOS.ResourceID" could not be bound.

Error Number: -2147217900

Source: Microsoft OLE DB Provider for SQL Server

Native Error: 4104

 

 

Finally got, I day and half later!

SELECT

v_R_System.Netbios_Name0,

v_GS_PC_BIOS.SerialNumber0,

v_R_System.User_Name0,

v_GS_SoftwareProduct.ProductName,

v_GS_SoftwareProduct.ProductVersion,

v_GS_SoftwareProduct.CompanyName

FROM v_GS_PC_BIOS JOIN v_GS_SoftwareProduct ON

v_GS_PC_BIOS.ResourceID = v_GS_SoftwareProduct.ResourceID

JOIN v_R_System ON

v_GS_SoftwareProduct.ResourceID = v_R_System.ResourceID

WHERE

v_GS_SoftwareProduct.ProductName = @variable

ORDER BY

v_GS_SoftwareProduct.ProductName, v_GS_SoftwareProduct.ProductVersion

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.