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 7 of 7
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    London & Oxford
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding a column to an Access Database

    Does anyone know the SQL statement needed to insert a yes/no tickbox column to a table in Access?

    The statement below works but it doesn't make a tickbox, only a 1/0 (boolean) field for some reason.

    ALTER TABLE table_name ADD COLUMN column_name YESNO

    Thanks in advance

    ..head8k..
    As easy as 3.1415926535897932384626433832795028841

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    I believe that yesno has to be in brackets plus you need a slash like:

    [yes/no]
    I would rather be a lion for a day than a lamb that lives forever.

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    London & Oxford
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks ecnarongi but it doesn't work.

    I tried your code in the SQL editor in Access and it gives a syntax error:

    ALTER TABLE table_name ADD COLUMN column_name [yes/no]

    Do you have a working example you can post?

    ..head8k..
    As easy as 3.1415926535897932384626433832795028841

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    I don't have it right now but I will post later on today
    I would rather be a lion for a day than a lamb that lives forever.

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    I can't find it , you might have to hack this one. when I look for examples all I get is the -1/0 boolean thing. sorry I could not be of more assistance.
    I would rather be a lion for a day than a lamb that lives forever.

  • #6
    New Coder
    Join Date
    Jun 2002
    Location
    London & Oxford
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for trying ecn... I'm beginning to think this is impossible.

    Anyone else?
    As easy as 3.1415926535897932384626433832795028841

  • #7
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I finally found it! YESNO

    Hey seems you need to say it as one word yesno

    this seemed to work
    ALTER TABLE myTable ADD COLUMN isLocked YESNO

    hth!


  •  

    Posting Permissions

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