3-state option for Yes/No please
3-state option for Yes/No please
In every database I've worked with, there is an option for 2-state or 3-state boolean, with the 3rd state being not selected. I would like to have that option in AIM.
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
Re: 3-state option for Yes/No please
Surely this is already there? Yes No and undefined. When you create a form for searching which includes a yes/no attribute, the drop down presents yo with three options, yes, no and nothing (or as I call it "I don't care")
I just fell foul of this when I put a search together "if Yes/no attribute <> No" found all the Yes's AND all the undefined
If you want a yes/no/don't know scenario - just use a plain text attribute with a choice list of your three options and then use radio buttons in the presentation
I just fell foul of this when I put a search together "if Yes/no attribute <> No" found all the Yes's AND all the undefined
If you want a yes/no/don't know scenario - just use a plain text attribute with a choice list of your three options and then use radio buttons in the presentation
Rocketman
V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
-
- Posts: 1460
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: 3-state option for Yes/No please
The null value of Yes/No can be problematic but for different reasons to your testing.
This is only testing if the attribute does not equal one state: NOT zero
1 is NOT zero, but NULL is also NOT zero.
If you want to search for Yes values and you allow NULL as a response option then you have to be explicit in that Yes/No attribute = ‘Yes’
I have found that searching for No can be problematic (for reasons that I can’t remember at the moment ) but it has required me to set the preferred default value to overcome.
UPDATE - Obviously once you set the Yes/No you lose the opportunity for NULL, that is to say, without running a process to set Yes/No to UNDEFINED, you can never change Yes to NULL only to No.
Code: Select all
if Yes/No attribute <> ‘No’
1 is NOT zero, but NULL is also NOT zero.
If you want to search for Yes values and you allow NULL as a response option then you have to be explicit in that Yes/No attribute = ‘Yes’
I have found that searching for No can be problematic (for reasons that I can’t remember at the moment ) but it has required me to set the preferred default value to overcome.
UPDATE - Obviously once you set the Yes/No you lose the opportunity for NULL, that is to say, without running a process to set Yes/No to UNDEFINED, you can never change Yes to NULL only to No.