Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Default Selection (Report)


Default Selection (Report)

Author
Message
GG_BI_GG
GG_BI_GG
SSC-Enthusiastic
SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)

Group: General Forum Members
Points: 114 Visits: 258
Hello SQL Gurus

I am currently working on a report that a default selection used to select customers. I use Visual studio business intelligence development studio. Here's a pre-selection of a parameter;

SQL syntax dataset customer:

select branch_n
from incident
join sectn_dept
on incident.sectn_dept_id = sectn_dept.sectn_dept_id
join sectn
on sectn_dept.sectn_id = sectn.sectn_id
join branch
on sectn.branch_id = branch.branch_id
where branch.stat_flag = 'n'
group by branch_n
order by branch_n

Parameter @client: Picture

Available Values​​: Picture

Default Values​​: Picture

You see that in my default values ​​I've manually done my customers and this may not work for a change, because the data in the default value is no longer correct. This in an environment where each day a change occurs.

I am now trying to set it to search by ID;

Each customer has an ID that they get for one year. This year, a customer a number 3953 .... With several numbers behind but it is important that the first 4 digits only to have by searching the customer.

My idea is to create than parameter @customer makes a selection in Default value that goes into a 2nd dataset that look those numbers.

select branch_n, sectn_dept.dept_sc
from incident
join sectn_dept
on incident.sectn_dept_id = sectn_dept.sectn_dept_id
join sectn
on sectn_dept.sectn_id = sectn.sectn_id
join branch
on sectn.branch_id = branch.branch_id
where branch.stat_flag = 'n'
group by branch_n, dept_sc
order by branch_n

So it looks like I used the same qeury but dept_sc does in the select statement. Can you tell me how I should address qeury and what I should build.



Thanks in advance Smile
Attachments
Customer.JPG (1 view, 39.00 KB)
Default Value.JPG (1 view, 32.00 KB)
available customers.JPG (2 views, 39.00 KB)
GG_BI_GG
GG_BI_GG
SSC-Enthusiastic
SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)

Group: General Forum Members
Points: 114 Visits: 258
I just make a dataset 2 with the following Syntax;

select sectn_dept.dept_sc
from incident
join sectn_dept
on incident.sectn_dept_id = sectn_dept.sectn_dept_id
join sectn
on sectn_dept.sectn_id = sectn.sectn_id
join branch
on sectn.branch_id = branch.branch_id
where branch.stat_flag = 'n' and dept_sc LIKE '3953%'
group by dept_sc

Now i get all the customers with a number 3953...

I just custom the parameter and it look now this; See pictures

I want now that the customers with the number 3953 will be select when I opening the report. When I opening know I get no pre-selection? How can I fix that (Look picture)
Attachments
Customer.JPG (2 views, 38.00 KB)
available customers.JPG (3 views, 39.00 KB)
Default Value.JPG (3 views, 36.00 KB)
no selection...JPG (2 views, 9.00 KB)
GG_BI_GG
GG_BI_GG
SSC-Enthusiastic
SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)

Group: General Forum Members
Points: 114 Visits: 258
By selecting a customer I get a follwoing error (ofcourse I get this when I matching a Nvarchar with a INT value)
Attachments
error.JPG (2 views, 16.00 KB)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search