例如 把 cans(原来类型为 varchar) 转换为 int 类型

解决方案 »

  1.   

    CAST 和 CONVERT
    将某种数据类型的表达式显式转换为另一种数据类型。CAST 和 CONVERT 提供相似的功能。语法
    使用 CAST:CAST ( expression AS data_type ) 使用 CONVERT:CONVERT (data_type[(length)], expression [, style])
      

  2.   

    strsql = "select tph,bzh,hh,cans from gc_yf where tph='" & Forminsert1.Combo1(0).Text & "' and cast(cans as int)>='" & Forminsert1.Text2(1).Text & "'"这样可以吗?
    但为什么运行结果仍然不对呢??