how to use swittch in where close?
this is my cod ="select fname from db where "&Switch( Fields!hot.Value,1, Fields!cold.Value,2)& "in" &Parameters!productfamily.Value
May 27th, 2012 3:48am

Hi There Where you are trying to use the code. Are you using the code inside dataset ? Please update Many thanks Syed Qazafi Anjum
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2012 4:03am

yes, in dataset
May 27th, 2012 5:08am

Hi There Can you please give more details what you are trying to achieve as You could not use your fields name inside your dataset. You can use your parameter but like this select fname from yourtable where YourTablefieldname =@productfamily select fname from db where YourTablefieldname =@productfamily where @productfamily is our paramter name Can you please also tell me what Fields!hot.Value and Fields!cold.Value Are they fields on your report? If that is the case then you could not use them in dataset like this Please update Many thanks Syed Qazafi Anjum Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2012 5:22am

i have two field with boolean values, withname, hot and cold, i define a visible multivalue parameter with name productfamily.and specified, two values for this parameter with name hot and value 1, name cold and value 2 i wanna when user select for example hot, the rows in db that hot field inside that is true , be displayed or if select hot and cold , row that hot field an coldfield inside that is true be dispalyed
May 27th, 2012 5:43am

i wanna at first change value of my database field from true and false to my own value then use it in sql command
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2012 5:52am

Hi Sabnam2012 Thanks for your posting I have managed to put something together for you. Please do the following Right click on your tablix and go to tablix properties and go to filters optionAdd a filter and in expression please select hotOperator please select INIn expression please put the following expression =iif(instr(join(Parameters!productfamily.Value,","),1)>0 and instr(join(Parameters!productfamily.Value,","),2)>0 ,Fields!Hot.Value,iif(instr(join(Parameters!productfamily.Value,","),1)>0,true,false))You are done I am putting some screenshot for your help If you have any questions please do ask. ManyThanks Syed Qazafi Anjum Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful --Your Filter Expression =iif(instr(join(Parameters!productfamily.Value,","),1)>0 and instr(join(Parameters!productfamily.Value,","),2)>0 ,Fields!Hot.Value,iif(instr(join(Parameters!productfamily.Value,","),1)>0,true,false))
May 27th, 2012 6:07pm

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

Other recent topics Other recent topics