Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2002
    Posts
    4

    Unanswered: Check Boxes in select statement

    I am working on a database, and some of the records in it are not meant to show up on the website. the determining factor is a check box in a column called Web_Site.

    how do i select only those with the checked check box?

    WHERE Sub_Category='" & This_Sub_Cat & "' & Web_Site=??? ORDER BY Sub_Category"

    thanks in advance,
    nick

  2. #2
    Join Date
    Feb 2002
    Location
    North Carolina
    Posts
    13
    Nick-

    Checkbox fields in columns evaluate to either Yes or No, True or False. Just check for whichever condition you need in your query, i.e.

    WHERE Sub_Category='" & This_Sub_Cat & "' & Web_Site=Yes ORDER BY Sub_Category"

    This would give you all the records where Web_Site is checked.

    If you need some more help, post back!

    Hope it helps,
    j-Dog

  3. #3
    Join Date
    Nov 2001
    Posts
    336
    Hi,

    You can beleive or not but since Web_Site field is a boolean one following statement should work too:

    WHERE Sub_Category='" & This_Sub_Cat & "' & Web_Site ORDER BY Sub_Category"

    Igor

  4. #4
    Join Date
    Feb 2002
    Location
    North Carolina
    Posts
    13
    Igor --

    Good call on that. Your statement is a little more concise as well. I sometimes forget that you can write things in that way with Yes/No fields.

    j-Dog

Posting Permissions

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