Question

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.

Was it helpful?

Solution

I think you must use a number, and so, it seems does Allen Browne, Access MVP.

OTHER TIPS

Not that I've found :( I haven't programmed Access in awhile, but what I remember involves quite a lot of isNull checks.

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top