Parameterized Query WayneH  2017-10-30 12:43
Status: Closed
 
Hi Jon,

created a small example for this question that reflects what I have in the project. (Queries are on the query tab)

1. I start with a dataset... which has a couple of fields which are datetime fields.. i chose to recode those into '1' meaning data is present or NULL/"N/A" (recode or recodeNA datasets) - this is only done because of the data I am receiving..

2. I then created another query where the parameters are specified. (date parameters to select a range and one additional for the CIDR field where data may either be 1/Null or 1/NA depending on the dataset)

3. In the query with null values, requesting the same data range and not specifying CIDR I get 3 rows returned , whereas in the query where these null values have even converted to "N/A" I get 8 rows returned (includes the converted rows)
Note: I had to create an exception so that a null value would default to the original otherwise the query would return no results. Seems the parameter cannot pass an empty value through to the query. But once I do this, values that were null have their rows simply dropped..

I attached the example in the archived study. I figure there must be a better way to do this... to allow a query to accept empty values or work with nulls without having to recode those to some value like "N/A"

Thanks,

W