JP Pentz
JP Pentz

Reputation: 7

Conversion failed on value

Who can help me on this?

select Battery_Volts
from ems
where Battery_Volts between 25 and 27

I am lost on this error:

Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value '25.19' to data type int.

Upvotes: 0

Views: 40

Answers (1)

Thom A
Thom A

Reputation: 95544

If my guess is correct, and you're using a varchar to store a numerical value, you could also try:

where Battery_Volts between 25.00 and 27.00

If you get a further conversion error, I imagine you have non numerical values in your data, which opens a further can of worms.

Upvotes: 1

Related Questions