Operand data type varchar is invalid for divide operator
when does this error happens ? need example.. pls
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rohatash KumarRank #12 · 57.7K reputationPosted Nov 18, 2013, 11:03 PM EST
You can convert like this way:
divide (CONVERT(int,your varchar column>))This will work if your varchar column actually holds numeric value. Otherwise, you can try casting it using
castfunction like:devide(cast(varchar_column as int))Hanook159 reputationPosted Nov 20, 2013, 8:45 PM EST
Even though you have numeric data in the column check the data types of the columns and then convert each column that is part of division operation to numeric ( int )