Boolean Field Problem 
Author Message
 Boolean Field Problem

Please forgive me if this is an FAQ, but I've just come over to
Filemaker. I have version 6.2 running under OS X.

I have a boolean field, in which I want to enter data either by a check
box or by simply typing "y" "yes" "n" or "no". But a boolean field is
numeric, and a check box only seems to work with a value list. Entering
a text value in the field causes an error, too.

What I wanted to do was have a check box where "checked" related to
"True" and "unchecked" gave "False".

Is this possible, and if so, how?

TIA,

Dave
--
David O Smith
Commercial & Fine Art Photographer
"Using my pictures to enhance your image"



Sun, 25 Dec 2005 05:33:27 GMT
 Boolean Field Problem

Define the field as a number field, format it with a checkbox using a 1/0
value list, and only display the first ('1') box. Checkboxes-- indeed any
kind of field formatting using a value list-- will accept all the main data
types (save for containers).

--
John Weinshel
Datagrace
Vashon Island, WA
(206) 463-1634
Associate Member, Filemaker Solutions Alliance



Quote:
> Please forgive me if this is an FAQ, but I've just come over to
> Filemaker. I have version 6.2 running under OS X.

> I have a boolean field, in which I want to enter data either by a check
> box or by simply typing "y" "yes" "n" or "no". But a boolean field is
> numeric, and a check box only seems to work with a value list. Entering
> a text value in the field causes an error, too.

> What I wanted to do was have a check box where "checked" related to
> "True" and "unchecked" gave "False".

> Is this possible, and if so, how?

> TIA,

> Dave
> --
> David O Smith
> Commercial & Fine Art Photographer
> "Using my pictures to enhance your image"



Sun, 25 Dec 2005 05:52:56 GMT
 Boolean Field Problem

Quote:

> Define the field as a number field, format it with a checkbox using a 1/0
> value list, and only display the first ('1') box. Checkboxes-- indeed any
> kind of field formatting using a value list-- will accept all the main data
> types (save for containers).

Thanks, John.

I gather if I don't mark the checkbox the field will be empty, rather
than containing 0. Is there a way round this, or doesn't it matter?

Thanks again,

Dave

--
David O Smith
Commercial & Fine Art Photographer
"Using my pictures to enhance your image"



Sun, 25 Dec 2005 18:25:01 GMT
 Boolean Field Problem


Quote:
>I gather if I don't mark the checkbox the field will be empty, rather
>than containing 0. Is there a way round this, or doesn't it matter?

I may be wrong, but I don't think it matters.  All my checkbox fields run
off a value list that only contains one entry, the number one.  So checked
is one, unchecked is nothing.  I have yet to encounter any problems
traceable to the lack of a zero value.  But I could be fooling myself.

But I suppose it depends on what you do with the fields when they are
working.  Are they used in numeric calculations somewhere, for example?

Steve Brown



Sun, 25 Dec 2005 19:58:14 GMT
 Boolean Field Problem
Define the field to auto-enter 0 as a calculation.

Whether it matters or not depends on what you do with the field values. If
you are building relationships from constants '1' and '0' to the field, then
you need the zero. If you are merely counting the 1's, then you do not.

--
John Weinshel
Datagrace
Vashon Island, WA
(206) 463-1634
Associate Member, Filemaker Solutions Alliance



Quote:

> > Define the field as a number field, format it with a checkbox using a
1/0
> > value list, and only display the first ('1') box. Checkboxes-- indeed
any
> > kind of field formatting using a value list-- will accept all the main
data
> > types (save for containers).

> Thanks, John.

> I gather if I don't mark the checkbox the field will be empty, rather
> than containing 0. Is there a way round this, or doesn't it matter?

> Thanks again,

> Dave

> --
> David O Smith
> Commercial & Fine Art Photographer
> "Using my pictures to enhance your image"



Sun, 25 Dec 2005 21:29:14 GMT
 Boolean Field Problem
All of my files include a valuelist called 'checkbox' that includes only
a '1'.  You don't need the zero unless you will be counting records
based on something being in that field.  It's either equal to one or its
not.  True or false.

I could be wrong on this, but it would also seem to be more efficient to
leave out the zeroes because only the fields with values get indexed.
If you have zeroes, than they must get indexed as well.  While the speed
benefit of not indexing the zeroes is probably so miniscule, it makes me
feel good to think that I have somehow beaten the system.

Quote:


>>Define the field as a number field, format it with a checkbox using a 1/0
>>value list, and only display the first ('1') box. Checkboxes-- indeed any
>>kind of field formatting using a value list-- will accept all the main data
>>types (save for containers).

> Thanks, John.

> I gather if I don't mark the checkbox the field will be empty, rather
> than containing 0. Is there a way round this, or doesn't it matter?

> Thanks again,

> Dave

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg              (818) 883-2846
FM Pro Solutions       Los Angeles, California
Associate Member, FileMaker Solutions Alliance


Sun, 25 Dec 2005 23:01:51 GMT
 Boolean Field Problem

Quote:


> >I gather if I don't mark the checkbox the field will be empty, rather
> >than containing 0. Is there a way round this, or doesn't it matter?

> I may be wrong, but I don't think it matters.  All my checkbox fields run
> off a value list that only contains one entry, the number one.  So checked
> is one, unchecked is nothing.

This is true, so you can do nothing that would depend on the value being
'false'. Like: if(value, result1, result2) or if (not value) do it;
If 'value' is indeterminate, then so is 'not value' and Filemaker has no
clue, whether this should mean yes or no. Often it just does nothing.


Mon, 26 Dec 2005 02:44:42 GMT
 Boolean Field Problem

Quote:



> > >I gather if I don't mark the checkbox the field will be empty, rather
> > >than containing 0. Is there a way round this, or doesn't it matter?

> > I may be wrong, but I don't think it matters.  All my checkbox fields run
> > off a value list that only contains one entry, the number one.  So checked
> > is one, unchecked is nothing.

> This is true, so you can do nothing that would depend on the value being
> 'false'. Like: if(value, result1, result2) or if (not value) do it;
> If 'value' is indeterminate, then so is 'not value' and Filemaker has no
> clue, whether this should mean yes or no. Often it just does nothing.

Which is why using the test If(value) is not recommended. While it DOES
work in the vast majority of cases to test for a true result, in some
circumstances it fails.

If(value = 1) works all the time. If(value <> 1) or IF(value = 0) are
equally good tests for false. A null value will read out to zero using
these tests.  The behavior of boolean fields changed (I think it was
with FM 5.5 but I could be mistaken) so that the explicit tests are more
reliable across versions of FM.

I too use a value list with only a "1" value. No zero is needed, as I
structure most of my tests to test for true and let the Else take care
of false values.
--
Lynn Allen              Allen & Allen Semiotics
FSA Associate           Filemaker Consulting & Training



Mon, 26 Dec 2005 03:10:06 GMT
 Boolean Field Problem

It doesn't matter whether you use 'y' or 'yes' or '1'.  FM
recognizes the following and automatically converts it in boolean in
numeric) fields:

Yes or Y or 1 or True or T
No or N or 0 or False or F

You can base your VL on any of these values.  The numeric field will
accept all of them.  And the boolean result will always be correct: 1
for Yes, Y, T or True or 1 ... and 0 for No, N, F or False or 0.

But it must be numeric.  Your Value List can be any of these. :)

See http://www.filemaker.com/support/techinfo.html Article
#101545.  As you can imagine, storing a single digit instead of 2-5
characters for the words can save space over thousands of records.

LaRetta

--
Posted via http://dbforums.com



Mon, 26 Dec 2005 04:38:37 GMT
 Boolean Field Problem
I was going to mention this in my original post, but decided not to
since I figured what you didn't know wouldn't hurt you.  But now that
you know, and although what LaRetta says is true, I would HIGHLY and
STRONGLY recommend against using anything other than 1 or 0 (or blank)
in a number field if you want to have it evaluate properly across all
versions of FileMaker.

No other databases recognize Yes, Y, T or True as boolean operators and
neither should you.  Also, if you ever needed to sum up the number of
trues across all fields, only the '1' will give you correct results.

Quote:

> You can base your VL on any of these values.  The numeric field will
> accept all of them.  And the boolean result will always be correct: 1
> for Yes, Y, T or True or 1 ... and 0 for No, N, F or False or 0.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg              (818) 883-2846
FM Pro Solutions       Los Angeles, California
Associate Member, FileMaker Solutions Alliance


Mon, 26 Dec 2005 05:53:55 GMT
 
 [ 10 post ] 

 Relevant Pages 

1. MDAC 2.1 and DAO: Problem with Boolean fields.

2. boolean fields in DAO recordsets - problem

3. Setting boolean field from date field values...

4. Add field with Boolean field type failed using ADOX

5. Boolean Full-Text searches and Field Scope

6. Create view from the table with multiple boolean fields

7. Updating a boolean field with the same information

8. Boolean fields

9. Quick searching of boolean fields?

10. Adding a boolean field

11. Boolean Values and Bit Fields

12. Boolean Fields


 
Powered by phpBB® Forum Software