I was wondering if there is a better way to cope with MS-Access' inability to handle NULL for boolean-values other than change the column-data-type to integer.
views:
598answers:
5Not that I've found :( I haven't programmed Access in awhile, but what I remember involves quite a lot of isNull checks.
I think you must use a number, and so, it seems does Allen Browne, Access MVP, in a response dated 17-Apr-07 10:16:35. http://www.eggheadcafe.com/software/aspnet/29743570/yesno-data-types.aspx
I think it depends on how you want your app/solution to interpret said NULLs in your data.
Do you want to simply "ignore" them in a report... i.e. have them print out as blank spaces or newlines? In that case you can use the handy IsNull function along with the "immediate if" iif() in either the SQL builder or a column in the regular Access query designer as follows:
IIF(IsNull(BooleanColumnName), NewLine/BlankSpace/Whatever, BooleanColumnName)
On the other hand, if you want to consider the NULLs as "False" values, you had better update the column and just change them with something like:
Update table
SET BooleanColumnName = FALSE
WHERE BooleanColumnName IS NULL