Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lincoln (UK)
    Posts
    138
    Thanks
    3
    Thanked 0 Times in 0 Posts

    update statment using checkboxes

    Hi All,
    I have a query that has been perplexing me for a while.
    When I write an update command, in the SQL I encase the runtime variable for
    a text field in inverted commas ('), date with (#)... But how do you update
    checkboxes?

    EG:
    Code:
    UPDATE textField = 'varText', numberField = varNumber Where (what ever)
    But what about checkbox (yes/no) fields?

    Please can someone enlighten me?

    TIA
    Justin

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lincoln (UK)
    Posts
    138
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I've found the solution for those who wish to know:

    In Access you would use 0 for false and -1 for true.
    In SQL Server you would use 0 for false and 1 for true.

  • #3
    New Coder
    Join Date
    Aug 2002
    Posts
    27
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I normally don't even bother using checkboxes - just have a number field where I enter 0 for false and 1 for true.

    Probably not the proper way to do it, but it does make things easy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •