Results 1 to 6 of 6
  1. #1
    Bradex is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Posts
    101

    Question Assign 1 or 0 for Yes or No field

    When I use Yes/No field in access, the data gets exported as True/False in Excel.

    Is there a way where I could assign 0/1 for a Yes/No field?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    yes, but just use -1 (which = true)

    thats what checkbox are for,
    thats what yes/no will also do.
    thats what TRUE/FALSE will also do.

    if you dont like the negative displayed, show in query as Abs([field]).

  3. #3
    Bradex is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Posts
    101
    Thanks for the reply.

    I was referring to the Yes/No data type in tables. I was hoping for a way to store the data directly as a number without the use of a query or form.

    From your answer, I understand that it is perhaps not possible, and the data can be stored only as Yes/No, True/False, or On/Off in the table.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Boolean (yes/no) fields are stored as -1 / 0 but displayed using one of the format methods you listed.
    Similarly date time field are stored as numbers but displayed in whatever format you choose
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    Bradex is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Posts
    101
    Thanks for the explanation. I was not aware of that.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 3
    Last Post: 11-19-2019, 05:15 PM
  2. Replies: 10
    Last Post: 11-30-2015, 12:16 PM
  3. Cant Assign a Value To This Date Field
    By burrina in forum Forms
    Replies: 0
    Last Post: 12-27-2012, 10:31 PM
  4. can't assign a new value to a form field
    By markjkubicki in forum Programming
    Replies: 4
    Last Post: 09-28-2012, 08:03 PM
  5. Replies: 2
    Last Post: 07-13-2012, 05:12 AM

Tags for this Thread

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