I have Query which need to be modified like if I pass zone=All then it should display all records else other condition. This query I have to use in SSRS Reports, it works in this condition.
select distinct zone, wardno,deptname,
cybertec_view_requests.statusname,
categoryname,opendate,probdesc
from cybertec_view_requests
left join cybertec_view_requests_comments on
cybertec_view_requests_comments.reqid = cybertec_view_requests.id_
where zone= ? and deptname=? and
opendate between ? and ? and categoryname=?
group by zone,wardno,deptname, cybertec_view_requests.statusname,
categoryname,opendate,probdesc
order by zone,wardno,deptname
try this