Results 1 to 7 of 7
  1. #1
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    486

    Use yes/no fields or just an integer

    I was wondering what the community thought about using an Access yes/no field vs using just an interger.

    For example, I can set the field to yes/no with the Format to True/False OR I could just create a number field and 0 means no and 1 means yes.



    Is one way better than another and if so why?

    Thanks

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Possibly everything you need to know on the subject

    http://allenbrowne.com/NoYesNo.html

    Basically, yes is -1, not 1
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    If you ever want to migrate to SQL Server then the integer route is better IMHO.

    You can still display them in Access as a check box or Yes/No without the pain they can inflict - read here http://allenbrowne.com/NoYesNo.html

    Edit: someone has faster fingers...
    Last edited by Minty; 11-24-2021 at 11:24 AM. Reason: Micron has faster fingers
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Reason: Micron has faster fingers
    I gotta be first sometimes!
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    486
    Thanks guys, That is what I was thinking too. I do plan to move the data to sql server so I will start just using an integer instead of a yes /no.

    Thanks

  6. #6
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    On behalf of both of us, you're welcome. Good luck with your project!
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Just a quick comment - the datasize for a yes/no field in sql server is a byte - so if you are going the 0/1 route, use a byte number size rather than long/integer etc. One less potential problem down the line.

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

Similar Threads

  1. Dim var@@@ As Integer Question...
    By Fish218 in forum Forms
    Replies: 4
    Last Post: 03-16-2012, 11:20 AM
  2. How to Set an Integer to Nothing
    By orcinus in forum Programming
    Replies: 4
    Last Post: 05-17-2011, 11:21 AM
  3. Integer not incrementing
    By jgelpi16 in forum Programming
    Replies: 2
    Last Post: 01-31-2011, 02:40 PM
  4. Adding column as INTEGER makes it a long integer?
    By luckycharms in forum Programming
    Replies: 2
    Last Post: 10-20-2010, 02:47 PM
  5. How to ADD integer (vba)
    By Computer202 in forum Programming
    Replies: 24
    Last Post: 03-13-2010, 08:50 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