开发者

SQL Default Values trouble

This is a SQL 2008 Reporting Services Reports question!

I have a parameter called Doors that depends on another parameter called City in it's SELECT statement.

If you have one City selected, it will select all of that City's Doors and populate the Door parameter with them, if you have both selected it will select only options that match the previous City. Like if I selected Auckland City, then deselected that and selected Christchurch, the Door parameter will populate with only values matching Auckland City

In the database, the Doors table contains 3 columns, one for ID(char(4)), one for OfficeID(int) and one for Name (char(20))

Can I make the default select-all work without changing the database? Or what changes do I need to make?

Query for selecting doors and also the default values

SELECT [ID] + ' - ' + CAST([CityID] as char(5)) AS [DoorID] , [Name] 
FROM [dbo].[Doors] 
WHERE ([CityID] IN (@City))

What the Table being refer开发者_StackOverflow中文版enced looks like :

ID      CityID Name
'0001'  1      'Front Door'
'0002'  1      'Bathroom Door'
'0001'  2      'Front Door'
'0002'  2      'Garage Door'


What are you using for your Value field in the Doors parameter? B/c if you are using ID, then you will see odd behavior (maybe as you have described) b/c ID is not unique, so if you were to use a composite value such as ID + CityID then you might resolve some oddities. Do you have a copy of the RDL file to look at?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜