2
Answers

operand data type varchar is invalid for divide operator

Roshan Ashroff

Roshan Ashroff

11y
4.8k
1
when does this error happens ? need example.. pls
Answers (2)
0
Hanook

Hanook

NA 371 1.2k 11y
The reason behind the above error is that you are trying to do division operation on varchar type data.... 
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 )
0
Rohatash Kumar

Rohatash Kumar

NA 25.5k 18.7m 11y
Roshan,

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 cast function like:

devide(cast(varchar_column as int))