Results 1 to 2 of 2
  1. #1
    gee21 is offline Novice
    Windows XP Access 2000
    Join Date
    Mar 2011
    Posts
    1

    Cool Yes/No values 0 and -1

    I've been reading up on Access for a while now and am still baffled about something that is starting to bug me.


    It is clear to me that in a Yes/No field, the value is equivalent to 0 when false - this part makes sense to me, but I don't understand why a true value is equivalent to -1 (instead of 1). In other words, why -1 as opposed to 1. Hope this post makes sense.

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I've been reading up on Access for a while now and am still baffled about something that is starting to bug me.
    It is clear to me that in a Yes/No field, the value is equivalent to 0 when false - this part makes sense to me, but I don't understand why a true value is equivalent to -1 (instead of 1). In other words, why -1 as opposed to 1. Hope this post makes sense.
    It is kind of strange that in Access TRUE = -1, while in Excel, TRUE = 1.

    IIRC, (and this was a long time ago) if you take zero and invert it (NOT 0), it becomes -1. Has something to do with bit wise shifts/ registers in the processor.

    Look at it this way. Zero = FALSE. So far, so good.
    If you then say TRUE = NOT FALSE, ANY number other than zero equals TRUE!

    Try making a table with several integer fields. Add a couple of records. Enter zeros is a few, positive numbers (large and small) in a few and negative numbers (large and small).

    Then create a form with the fields and add an equal number of check boxes bound to the fields. Only the check boxes that are zero will be unchecked. All others will be checked!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Yes/No Values
    By maintt in forum Reports
    Replies: 3
    Last Post: 07-19-2010, 05:16 PM
  2. Replies: 8
    Last Post: 05-25-2010, 04:50 AM
  3. Replies: 3
    Last Post: 04-04-2010, 05:26 PM
  4. Replies: 1
    Last Post: 03-27-2010, 06:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums