Home Forums SQL Server 2005 T-SQL (SS2K5) Arithmetic overflow error converting varchar to data type numeric. RE: Arithmetic overflow error converting varchar to data type numeric.

  • Thanks very much Craig, I think you're on the right track. I should point out that the data I'm searching usually has 1 or 2 digits to the left of the decimal point and either none or 1 to the right, for example "4.5" or "10.2" or "5"

    I couldn't get it to work with a " > " or " < " symbol but I could with " = ". I tested all this in the main query, not the subquery - hope that's right:

    WHERE LEN (COL) = 4 resulted in all the values 10.0 and above

    WHERE LEN (COL) = 3 resulted in all the values 9.9 and below

    WHERE LEN (COL) = 1 resulted in all the values without decimals

    I still need to get everything together though. I tried different numbers in DECIMAL(4,2) but it didn't make any difference. Must be close now!!! Thanks