Random number in results searching IDNUMBER >= '1000205830' and IDNUMBER

  • IDNUMBER >= '1000205830' and IDNUMBER <= '1000206010' ORDER BY ID_NUM DESC

    I'm also getting IDNUMBER 1000206 included in my results?

  • You are comparing strings, not numbers.

    '1000205830'

    '1000206'

    '1000206010'

    --Vadim R.

  • rvadim is correct

    just take the single quotes out of the query. - however if you have stored this as varchar (which is madness) thenyou need to use convert or cast on those values... but even better is to make sure it's an int and get rid of the quotes

    MVDBA

Viewing 3 posts - 1 through 2 (of 2 total)

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