Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Location
    Atlanta, GA
    Posts
    191

    Unanswered: new to SQL Server....

    Hi all....

    This is probably just very simple and silly... but being new to SQL... I guess I'm just stuck. FYI, the code I'm using works fine with an Access database.

    I have a table with a field defined as: [isadmin] [bit] NOT NULL

    After fetching a record from this table, I'm trying to use the contents of the isadmin field in a function... SetStatus(x) where x is needs to be a true/false boolean value in the function.

    The trouble is... the code errs out on the SetStatus(isadmin) function call. The error is "type mismatch".

    A response.write as the first line in the SetStatus function shows that nothing inside the function is being executed.

    A response.write for rs("isadmin") just prior to the function call shows it as False. (I thought there might be a NULL value issue, but that doesn's appear to be the case.)

    I've tried SetStatus(rs("isadmin")), SetStatus(CBool(rs("isadmin"))), and also

    If rs("isadmin") then isadminval=true else isadminval=false
    SetStatus(isadminval)

    ALL the above generate the same Type Mismatch error.

    Any ideas??? I'm stumped!

    Tim
    Tim

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    There is no boolean data type in sql server...

    where are you running this

    BOL:

    bit
    Integer data type 1, 0, or NULL.
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Mar 2003
    Location
    Atlanta, GA
    Posts
    191
    Yes, I understand that.

    As stated in my post, I have a table with a field defined as: [isadmin] [bit] NOT NULL

    I guess the heart of my question is how to USE the bit data to perform a boolean operation?

    Tim
    Tim

  4. #4
    Join Date
    Mar 2003
    Location
    Atlanta, GA
    Posts
    191

    Ahhhh... the light comes...

    I just realized that the bit data is an INTEGER value. A-HA.....

    Thanks.

    Tim
    Tim

Posting Permissions

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