Results 1 to 3 of 3

Thread: Booleans?

  1. #1
    Join Date
    Sep 2003
    Posts
    4

    Question Unanswered: Booleans?

    Hello.
    I just changed the databases of a website from Access to SQL Server.
    Converting the bases went smothly, but now I recieve error message to my SQL-quereries:
    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'True'.

    The query is: "Select pieces,date from orders where active = True AND company_id <> 19 AND authorize_wait = 0 ORDER BY send_date desc"

    When I change int the query to: "active = 1" the page works like before (with Access)

    I supose SQL Server is able to understand commands with True/False-quereries, so what is wrong here?
    Thank you for your help
    /Calle

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    MSSQL does not define a "True" or "False" variable. You need to either use a one as you have in your example OR define a local variable

    Code:
    declare @True bit 
    set @True = 1
    Select pieces,date 
      from orders 
     where active = @True 
       AND company_id <> 19 
       AND authorize_wait = 0 
     ORDER BY send_date desc
    Paul Young
    (Knowledge is power! Get some!)

  3. #3
    Join Date
    Sep 2003
    Posts
    4

    Smile

    Thank you for your response!
    /Calle

Posting Permissions

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