• why are you storing numeric values in a varchar column. As experienced, this will get you in troubles.

    ( in most cases because of formatting issues or just because someone put non-numeric data in it)

    There must be a zero ( 0 ) in your t1.B column.

    add a case statement to check it so it doesn't produce the error.

    select t1.a / case t1.b when 0 then NULL /* to the result will be null */

    else t1.B

    end as TheResult

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me