How to use parameter values as a condition in SSRS Query..
date_from :datetime
date_to :datetime
cust: text (label:Yes , Value :Y & Label :No , value:N)
Query:
SELECT dbo.incident.incident_ref,Customer.cust_n,incident.date_logged
FROM incident
INNER JOIN Customer ON incident.incident_id = Customer.cust_id
WHERE incident.date_logged BETWEEN @date_from AND DATEADD(day, 1, @date_to)
I would to use a condition here to display customer based on my selection in dropdownlist
(Include ABC)
You could try changing the query to:
SELECT dbo.incident.incident_ref,Customer.cust_n,incident.date_logged
FROM incident
INNER JOIN Customer ON incident.incident_id = Customer.cust_id
WHERE
incident.date_logged BETWEEN @date_from AND DATEADD(day, 1, @date_to) and
customer.cust_n = (case when @cust = 'N' and customer.cust_n = 'ABC' then NULL else customer.cust_n end)