Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)

  • RE: SQL and binary numbers

    I would if i could, but the tables are built by a program that was written from the manufacturs of the mainframe, each night it rebuilds the tables and then...

  • RE: SQL and binary numbers

    Yes that works. must be down to the way i was trying to explicitly convert it to binary when the & would implicitly do that?

    if i do

    where C.X_stat & 32...

  • RE: SQL and binary numbers

    if do

    select convert(varbinary, C.X_stat)

    from C

    where C.X_Stat = 0

    it returns 0x0C00000100000000

    but if i do

    select convert(binary(10), 0)

    it returns 0x00000000000000000000

    I think the problem is the 1 in 9th digit, it always returns this...

  • RE: SQL and binary numbers

    it does and it returns 0 for all rows, which confuses me some more! (not hard i guess)

  • RE: SQL and binary numbers

    looking at that link

    In a bitwise operation, only one expression can be of either binary or varbinary data type.

  • RE: SQL and binary numbers

    I have, if i convert 32 (which is decimal in the field) to varbinary i get this

    0x0C00000120000000

    then in the where clause i try convert(varbinary, C.X_stat) & 32 = 32 i...

  • RE: SQL and binary numbers

    the field is stored as a decimal number which is coming back as '&' operator is incompatible with decimal and int types....

Viewing 7 posts - 1 through 7 (of 7 total)