yes/no fields not working in sql

Posted on 2007-08-06
Last Modified: 2008-01-09
I had an access database which I have had to move to sql.  I am accessing it through an access front end -( .mdb not adp) with an odbc connection.  I had alot of fields in my access database which were yes/no fields and my forms had check boxes for them.  Since moving my database to sql the values are still there, ex: the yes shows up as -1 and nos show as 0.  They are bit datatypes in the sql database and yet still show as yes/no fields inn the access front end.  However, my check boxes don't work anymore.  Here is the criteria that I had on each check box (with different field names.)
They worked great before.  How can I get them working now that my db is in sql?
Question by:ksilvoso
    LVL 142

    Accepted Solution

    you will have to use the -1 (true) and 0 (false) explicitely:
    LVL 65

    Expert Comment

    by:Jim Horn
    Make sure your Access checkboxes do NOT have the Triple State property set to Yes, which allows Yes, No, and NULL.
    Then, go into your SQL table, bit column, and run an UPDATE query to convert any NULL values to Yes or No (whichever you prefer)

    Last I remember there is a known issue with SQL bit fields, where when you enter a NULL value in a record it locks that table for future editing.
    LVL 1

    Author Comment

      I tried that and it still doesn't work.  Should the field type be something other than bit?
    LVL 1

    Author Comment

    I changed it to this and it works now.  Thanks!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
    Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now