Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. What I'm I missing?

What I'm I missing?

Scheduled Pinned Locked Moved Database
databasequestionannouncement
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DJ Matthews
    wrote on last edited by
    #1

    Hi all, I've created a website the is using SQL 2000/SQL2005 as the back end and I've been tasked to take the catalog I've build for the website and allow it to be ran on a CD. So With the CD version of the website I'm using a Access 2003 database, but for some reason my T-SQL queries wont work with Access. I have a bit field in my SQL database that I use as an Active flag. Access use a "Yes/No" field for this and I'm not sure why the query isn't working. I did notice that Access uses -1/0 and not 1/0, so I changed my query to reflect this:

    SELECT *
    FROM tblWeb_E_Catalog_Categories
    WHERE (Active) = -1)

    Is there any reason why this wouldn't work?

    D L 2 Replies Last reply
    0
    • D DJ Matthews

      Hi all, I've created a website the is using SQL 2000/SQL2005 as the back end and I've been tasked to take the catalog I've build for the website and allow it to be ran on a CD. So With the CD version of the website I'm using a Access 2003 database, but for some reason my T-SQL queries wont work with Access. I have a bit field in my SQL database that I use as an Active flag. Access use a "Yes/No" field for this and I'm not sure why the query isn't working. I did notice that Access uses -1/0 and not 1/0, so I changed my query to reflect this:

      SELECT *
      FROM tblWeb_E_Catalog_Categories
      WHERE (Active) = -1)

      Is there any reason why this wouldn't work?

      D Offline
      D Offline
      David Mujica
      wrote on last edited by
      #2

      I see two closing parenthesis )) and only 1 open parenthesis. (

      D 1 Reply Last reply
      0
      • D David Mujica

        I see two closing parenthesis )) and only 1 open parenthesis. (

        D Offline
        D Offline
        DJ Matthews
        wrote on last edited by
        #3

        *slaps forehead* I should have seen that. But changing it to this doesn't work either. I tried all of the following and none seem to work.

        SELECT *
        FROM tblWeb_E_Catalog_Categories
        WHERE ((Active) = -1)

        or

        SELECT *
        FROM tblWeb_E_Catalog_Categories
        WHERE ((Active) = TRUE)

        or

        SELECT *
        FROM tblWeb_E_Catalog_Categories
        WHERE (Active = TRUE)

        1 Reply Last reply
        0
        • D DJ Matthews

          Hi all, I've created a website the is using SQL 2000/SQL2005 as the back end and I've been tasked to take the catalog I've build for the website and allow it to be ran on a CD. So With the CD version of the website I'm using a Access 2003 database, but for some reason my T-SQL queries wont work with Access. I have a bit field in my SQL database that I use as an Active flag. Access use a "Yes/No" field for this and I'm not sure why the query isn't working. I did notice that Access uses -1/0 and not 1/0, so I changed my query to reflect this:

          SELECT *
          FROM tblWeb_E_Catalog_Categories
          WHERE (Active) = -1)

          Is there any reason why this wouldn't work?

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Hi, ... WHERE NOT (Active = 0) might work for both database systems. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


          D 1 Reply Last reply
          0
          • L Luc Pattyn

            Hi, ... WHERE NOT (Active = 0) might work for both database systems. :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


            D Offline
            D Offline
            DJ Matthews
            wrote on last edited by
            #5

            Holy smokes Batman... it worked! Thanks!!!

            L 1 Reply Last reply
            0
            • D DJ Matthews

              Holy smokes Batman... it worked! Thanks!!!

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              You're welcome. :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups