I'm relatively new to SQL - I'm not sure if I'm doing this right. I added pretty pics. I have a query where I want to populate a parameter(based on another parameter that you input via a drop-down menu, which is the @ResponseRange var you see)
SELECT
CASE
WHEN crr.Name = 'Prescreens' THEN null
ELSE crr.Codes
END
FROM Client_Response_Ranges_for_SSRS_Respondent_Answer crr
where crr.Codes = @ResponseRange;
This is how that crr tables looks(it was just custom table for query):
ResponseRange
More info: so I have 6 parameters, and they are
BeginDate
EndDAte
SurveyID
SupplierID
ResponseRange
ClientResponseRange
The thing is that ClientResponseRange depends on ResponseRange - so actually ClientResponseRange is hidden. For all the choices of ResponseRange except one, I will automatically use whatever ResponseRange's value for ClientResponseRange. I'm doing something wrong, but I don't know what.. thanks very much any tips appreciated.
That is because your query is trying to check for NULL = NULL
Add this to your query, if that is what you want to do:
SET ANSI_NULLS OFF
However, there are some ambiguties with your query:
Raj