Using BETWEEN on a varchar field not a numeric field?

早过忘川 提交于 2019-12-05 16:31:41

You need to CAST the results WHERE ISNUMERIC(column) = 1 AND CAST(column AS decimal(10,5)) BETWEEN 1 AND 2 for example.

One more option

Implicit transformation is carried out nvarchar() into numeric()

Cost of operations obvious and implicit transformation equals, but code a little bit it is less;))

  • Predicate

SELECT *
FROM dbo.your_table
WHERE [COLUMN] BETWEEN 1.00 AND 2.00
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!