Jump to content


  • 0
P@docIT

Report prompt help

Question

I have a report that shows me the BIOS info for all Dell's in my environment, it works great.

 

SELECT CompName.Name0 as 'Computer Name', CompSys.Model0 as 'Model', BIOS.SMBIOSBIOSVERSION0 as 'BIOSVersion', CompSys.Manufacturer0 as 'OEM'

FROM V_R_System as Sys

LEFT JOIN V_GS_PC_BIOS as BIOS on Sys.resourceid = BIOS.resourceid

LEFT JOIN V_GS_COMPUTER_SYSTEM as CompSys on Sys.resourceid = CompSys.resourceid

LEFT JOIN V_GS_SYSTEM as CompName on Sys.resourceid = CompName.resourceid

WHERE

 

CompSys.Manufacturer0 LIKE '%dell%'

AND (CompSys.Model0 LIKE '%optiplex%'

OR CompSys.Model0 LIKE '%latitude%'

OR CompSys.Model0 LIKE '%precision%')

 

GROUP BY CompSys.Manufacturer0,CompSys.model0, BIOS.SMBIOSBIOSVersion0, CompName.Name0

ORDER BY CompSys.Model0, BIOS.SMBIOSBIOSVersion0

 

However I would like to create a prompt that will allow me to enter a model # and only see those models. So far i have tried the two examples below but they both still return all models instead of the model specified in the prompt.(screenshot) Actually I just did a test and typed some random string of letters in the prompt and it gives the whole report. So the prompt doesn't appear to be doing anything.

 

begin

if (@__filterwildcard = '')

SELECT DISTINCT CompSys.Model0 from v_GS_COMPUTER_SYSTEM as CompSys Order by CompSys.Model0

else

SELECT DISTINCT CompSys.Model0 from v_GS_COMPUTER_SYSTEM as CompSys

WHERE CompSys.Model0 like @__filterwildcard

Order by CompSys.Model0

end

 

Tried this with and without the distinct:

select distinct Model0 from v_GS_COMPUTER_SYSTEM

post-10749-0-91299400-1332776253_thumb.png

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

RESOLVED

 

Report SQL:

SELECT CompName.Name0 as 'Computer Name', CompSys.Model0 as 'Model', BIOS.SMBIOSBIOSVERSION0 as 'BIOSVersion', CompSys.Manufacturer0 as 'OEM'

FROM V_R_System as Sys

LEFT JOIN V_GS_PC_BIOS as BIOS on Sys.resourceid = BIOS.resourceid

LEFT JOIN V_GS_COMPUTER_SYSTEM as CompSys on Sys.resourceid = CompSys.resourceid

LEFT JOIN V_GS_SYSTEM as CompName on Sys.resourceid = CompName.resourceid

WHERE

 

CompSys.Manufacturer0 LIKE '%dell%'

AND CompSys.Model0 LIKE @variable

 

GROUP BY CompSys.Manufacturer0,CompSys.model0, BIOS.SMBIOSBIOSVersion0, CompName.Name0

ORDER BY CompSys.Model0, BIOS.SMBIOSBIOSVersion0

 

Prompt Properties:

Note: The name must be variable.

begin

if (@__filterwildcard = '')

SELECT DISTINCT CompSys.Model0 from v_GS_COMPUTER_SYSTEM as CompSys Order by CompSys.Model0

else

SELECT DISTINCT CompSys.Model0 from v_GS_COMPUTER_SYSTEM as CompSys

WHERE CompSys.Model0 like @__filterwildcard

Order by CompSys.Model0

end

post-10749-0-12850000-1332786252_thumb.png

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.