Problem with SQLServer and Bitwise operators

  • jane.alford (7/16/2012)


    What do you see when you print sSQL right after this statement?

    sSQL = "SELECT * FROM parameters WHERE printer_type & " & pType & " = " & pType & ""Does the variable pType maybe get converted to something odd? If the string is correct, the first thing I would try is add parentheses around the bit AND, like so:

    sSQL = "SELECT * FROM parameters WHERE (printer_type & " & pType & ") = " & pType & ""Sometimes operator precedence gets hashed up in translation from one language to another.

    And BTW, the trailing & "" shouldn't be necessary - concatenating an empty string onto the tail of your query string should have zero effect.

  • pdanes (7/18/2012)


    Thanks for that. I got it working. See my previous reply.

Viewing 2 posts - 16 through 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply