Question
Help with NULL values in WHERE variables
I can't get my SQL query to work.
SELECT *
FROM products
WHERE products.div_id = var1 AND products.grp_id = var2 AND
products.seg_id = var3
When I test the SQL in the advanced recordset dialog using the test
button it returns No Data. I have set the default of the variables to
values that I know exist. This is clearly related to NULL values in
products.seg_id. When I run the test on just the first two variables
(without products.seg_id) it returns correctly, but as soon as I include
the third variable I get No Data when tested. I don't know how to enter
a NULL value in the dialog to test for those records that have a NULL
value. What do I put in the Default value parameter to test for NULL
values?
SELECT *
FROM products
WHERE products.div_id = var1 AND products.grp_id = var2 AND
products.seg_id = var3
When I test the SQL in the advanced recordset dialog using the test
button it returns No Data. I have set the default of the variables to
values that I know exist. This is clearly related to NULL values in
products.seg_id. When I run the test on just the first two variables
(without products.seg_id) it returns correctly, but as soon as I include
the third variable I get No Data when tested. I don't know how to enter
a NULL value in the dialog to test for those records that have a NULL
value. What do I put in the Default value parameter to test for NULL
values?
