Note that there are some explanatory texts on larger screens.

plurals
  1. POsimple where clause SSRS 2005 parameter not working
    primarykey
    data
    text
    <p>this should be a simple thing but I've spent hours to no avail. Basically, I need to look up a salesrep # in a SQL database using the user's Window's user id. The format of the user id is "Norstar\kjones" and I need the "kjones" portion of it.</p> <p>using the split function, I am able to pull just the 'kjones' part out:</p> <pre><code>split(User!UserID,"\").GetValue(1) </code></pre> <p>I've created a parameter called SlsmnNum and created a dataset to be used to look up the salesrep # using the user id (the slsm_num field is a varchar, not an integer):</p> <pre><code>select slsm_num from Salesman_Msid where slsm_msid = ''' + split(User!UserID,"\").GetValue(1) + ''' </code></pre> <p>However, I get no results. How can I get the select to work?</p> <p>alternatively, I tried the following: in parameter SlsmnNum, I set the default to an expression using: <code>split(User!UserID,"\").GetValue(1)</code> and this returns 'kjones', as expected.</p> <p>I created a SECOND parameter (which is positioned BELOW the <code>SlsmnNum</code> parameter), <code>SlsmnNum2</code>, that has a default (and an available) value using a query, which is a dataset containing the following select statement:</p> <pre><code>select slsm_num from Salesman_Msid where slsm_msid = (@SlsmnNum) </code></pre> <p>When I run the query on the Data tab, when I type in 'kjones' into the parameter box, it returns '1366', the salesrep # I'm expecting. </p> <p>But, when I Preview the report, all I get in <code>SlsmnNum2</code> box is <code>Select a Value</code> and nothing is there (it should return '1366').</p> <p>Any help would be greatly appreciated!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload