Reading in TRUE/FALSE from Excel SS to Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mcupito
    Contributor
    • Aug 2013
    • 294

    Reading in TRUE/FALSE from Excel SS to Access

    The title kind of speaks for itself. I have a field predetermined in Access that should be a Yes/No data type with True/False format. When I read it in, Access always cuts it off.

    My solution is that I allowed access to create the table for me, however, it read the true/false in as a number (-1 = true, 0 = false).

    Is there a way to read this data in without some kind of work-around? I've browsed but nothing has helped me thus far...


    Thanks!
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32661

    #2
    It may help you to know that True, in Access, is stored as a numeric value of -1, and that False is stored the same way as 0.

    Thus, the data you're importing is perfectly correct. It is simply how it is formatted to display that makes it seem any different.

    This explains why you haven't found solutions to this 'problem' anywhere on the web.

    Comment

    • mcupito
      Contributor
      • Aug 2013
      • 294

      #3
      Thanks for the reply, NeoPa. The part I am confused on is why doesn't Access read it in as True/False or Yes/No. It read it in as a Number data type when I let Access create the table. When I try to read in the data from Excel without allowing Access to create the table, it cuts out the "FALSE" tuples.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32661

        #4
        There is nothing to tell it that the data is Boolean other than the format. If it were to try to handle the data as formatted rather than as stored then there would be a lot of very confused users of the system.

        Rather, it deals with the data it finds. Excel doesn't have any concept of Boolean data, so Access cannot interpret any data that way. It's not human to make guesses related to how the code is displayed, and if it were it would be highly unpredictable. How it works now is probably the most sensible approach given the current circumstances.

        Comment

        • mcupito
          Contributor
          • Aug 2013
          • 294

          #5
          Thanks for the explanation, NeoPa!

          Comment

          Working...