September 30, 2013 at 1:27 am
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 🙂
September 30, 2013 at 1:42 am
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)
September 30, 2013 at 1:52 am
By selecting a customer I get a follwoing error (ofcourse I get this when I matching a Nvarchar with a INT value)
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply