Checkbox parameter that triggers additional where clause
Hi Everyone, I'd like to create a report that contains a checkbox parameter that activates an additional where clause in my query. How can i achieve this? For example: Unchecked: Select * from Table Where x > 1000 Checked: Select * from Table Where x > 1000 and y > 3000 Thanks!
May 16th, 2012 8:32am

Hi There You could have a radio button type parameter which is Boolean type parameter and when it is true you can run Select * from Table Where x > 1000 And when it is false you can run this query Select * from Table Where x > 1000 and y > 3000 Please let me know if you have any questions 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 16th, 2012 8:41am

Hello, Yes, this is what i want to achieve but i don't know how i have to write my SQL query to get this result. How do i embed the parameter in the query? Regards,
May 16th, 2012 8:45am

Hi There Please define a Boolean parameter in your report, For example your parameter name is @Bool and it should be have type Boolean then you can write expression something like this inside your dataset Please let me know if you have any questions If @Bool=true Select * from Table Where x > 1000 and y > 3000 elseSelect * fromTableWhere x > 1000 Please let me know if you have any questions 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 16th, 2012 8:53am

Works fine, thanks. I almost never use If statements.. should try that more..!
May 16th, 2012 9:00am

Hi I am happy your problem has been resolved. Every day we learn something new from each other this is what we called sharing thought Good luck for your projectPlease let me know if you have any questions 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 16th, 2012 9:07am

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

Other recent topics Other recent topics