SSRS question
I have a column product_no in table Product..the values are like 0000000000000000000000000000000000060480, 0000000000000000000000000000000000116788, 0000000000000000000000000000000000119726, 550-500569, 320-00185, 310-PC852912A-000A etc. So, the requirement is that to show these product nos. without 0s like 60480,116788,119726,550-500569,320-00185, 310-PC852912A-000A to the user..which I have achieved using SELECT DISTINCT substring(product_no, patindex('%[^0]%',product_no), 18) as NEW_prod_no FROM XXX Now my problem is that this product no. field/parameter is a multi-valued parameter..so when the user selects multiple products..I get the values back as.. '60480,116788,119726,550-500569,320-00185, 310-PC852912A-000A' Now I have to insert those 0s back into the product nos. so that I can process them.. e.g. my query will be select product_name from xxx where product_no in ('0000000000000000000000000000000000060480', '0000000000000000000000000000000000116788', '0000000000000000000000000000000000119726', '550-500569', '320-00185', '310-PC852912A-000A' ) Can anybody help me in getting this logic worked out..thanks in advance..
July 8th, 2011 12:51pm

Got the answer: In the report parameters dialog box, you can set the label and the value to be different. The label is what people see, the value is what is used. For example, if you change your dataset query to return two fields (the unchanged product_no and the new product_no), then you can select the label to be the new product_no field and the value to still be the old product_no field. E.g. SELECT DISTINCT product_no, substring(product_no, patindex('%[^0]%',product_no), 18) as NEW_prod_no FROM XXX That way, people don't see the zeroes in the parameter drop-down, but they are still there for your query. Thanks to Leonard for this..
Free Windows Admin Tool Kit Click here and download it now
July 8th, 2011 1:31pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics