比如
select * from test 
where ziduan>a
and ziduan<b
其中a和b为两个real类型的数值,只要a 或b中有一个的整数位为0,就会提示如下消息:
服务器: 消息 8115,级别 16,状态 8,行 1
将 numeric 转换为数据类型 numeric 时发生算术溢出错误。如果a和b这两个数中的整数位不为0,则没有错误提示。请教各位这是怎么回事啊,而且相同的程序昨天并没有这个错误提示。
麻烦各位大虾了,给在下支个招吧。

解决方案 »

  1.   

    但是数据库我也没有改动过阿?为什么数值不能是0.xxxxx呢???
    这个怎么解决阿?
      

  2.   

    select * from test 
    where ziduan between a and b试试吧~!!
      

  3.   

    select * from test 
    where ziduan>cast(a as numeric)
    and ziduan<cast(b as numeric)
      

  4.   

    或者
    select * from test 
    where ziduan>cast(a as real)
    and ziduan<cast(b as real)