use database
select Fdate '日期',Fcheck as '审核',Fclose as '关闭',FBillNo as '订单号',
SUM(CAST(FBaseQty AS INT)) as '汇总数量',MAX(FSenddate) AS '最迟交货日期',
SUM(CAST(FstockQty AS INT)) as '汇总入库数量',
SUM(Fallamount) as '汇总金额',FEmpIDName as '业务员'
from vwICBill_26
where '汇总入库数量'-'汇总数量'< 0
and fdate >'2008-09-01' GROUP BY FBillNo,Fdate,Fcheck,Fclose,FEmpIDName
ORDER BY '最迟交货日期' DESC
为什么总是提示 执行错误:对数据类型而言运算符无效。运算符为 subtract,类型为 varchar。呢??
FBaseQty FstockQty 原来的数据类型为decimal(10,2) 不用CAST转换仍有这样的错误
------解决方案--------------------