I have three fields that are searchable:
- Name (textfield) - Presence (combobox: Yes/No) - Room (combobox: Yes/No)
Now I want to be able to search for Room=Yes with Presence=*, or for Presence=Yes and Room=*.
I am aware that Dynamic Views currently does not support the OR condition, but I thought I might be able to achieve a similar result by adding a third option to the comboboxes: '---' with the value NULL using the following query:
Select '---' as SearchOption, NULL as SearchOptionValue
UNION
Select 'Yes' as SearchOption, 'Yes' as SearchOptionValue
UNION
Select 'No' as SearchOption, 'No' as SearchOptionValue
This is because the Dynamic Views documentation states the following:
"Leaving the search criteria to be „equal‟ or „contains‟ will render results if the field is null or blank; by using this method you can have multiple fields such as zip code, city, and state, and allow the user to search based on only the fields that they enter search terms form"
Therefore, I thought I simulate making a field blank by sending a NULL value to SQL. This does not seem to work for me, any other work arounds, or thoughts on this subject?
Thanks,
Marc.
|