How to compare a variable against an sql bit field

Discussion in 'ASP General' started by Mirovk, Sep 12, 2006.

  1. Mirovk

    Mirovk Guest

    I am having problems making a comparison into my asp program when I
    compare against a bit field.

    the sintaxis used was:

    if (rs_cu("bt_nac") <> 1) then .......

    I made the query using the query analyzer and saw that the field value
    was NULL so I made the question

    if (rs_cu("bt_nac") = NULL) then ........


    Either of both questions the program flow via Else instead the
    condition were attained.

    Help appreciatted.

    PD: The SQL construction is shown below:

    1.- SQL = "SELECT carrito.*, Productos.ca_producto AS ca_producto,
    Productos.co_imp_iva AS co_imp_iva, Productos.nu_peso AS nu_peso,"
    SQL = SQL & " Productos.nu_dim_alto AS nu_dim_alto,
    Productos.nu_dim_largo AS nu_dim_largo, Productos.nu_dim_ancho AS
    nu_dim_ancho, Productos.bt_nac AS bt_nac"
    SQL = SQL & " FROM carrito INNER JOIN"
    SQL = SQL & " Productos ON Productos.co_producto =
    carrito.co_producto"
    SQL = SQL & " WHERE (carrito.id_session = " & session.SessionID & ")"

    2.- The query result was (the last field was bt_nac):
    2069 783347814 37313 1 2006-09-12
    00:43:16.700 22500.0000 4500.0000 0 0 NULL 0.69999999 5.5 10.5 10.5 NULL
    Mirovk, Sep 12, 2006
    #1
    1. Advertising

  2. Mirovk

    Mirovk Guest

    Thanks!!!
    Mirovk, Sep 12, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    1,719
    Timothy Bendfelt
    Jan 19, 2007
  2. Replies:
    9
    Views:
    941
    Juha Nieminen
    Aug 22, 2007
  3. ShaggyMoose

    Compare node set against a string

    ShaggyMoose, Mar 13, 2008, in forum: XML
    Replies:
    6
    Views:
    1,406
    ShaggyMoose
    Mar 14, 2008
  4. Replies:
    7
    Views:
    102
    James Edward Gray II
    Jul 4, 2005
  5. Jeff.M
    Replies:
    6
    Views:
    163
    Lasse Reichstein Nielsen
    May 4, 2009
Loading...

Share This Page