标题:SQL ERROR CODE:260
只看楼主
scindy
Rank: 1
等 级:新手上路
威 望:1
帖 子:591
专家分:4
注 册:2006-10-23
结帖率:50%
 问题点数:0 回复次数:0 
SQL ERROR CODE:260


大家帮我看一下这个问题:

在查询分析器里面能执行,但放到一个软件里作为报表来使用的时候就提示:
SQL ERROR CODE:260

260错误信息为:不允许从数据类型 %1! 到数据类型 %2! 的隐性转换(表 ''%3!'',列 ''%5!'')。请使用 CONVERT 函数来运行此查询。


SET NOCOUNT ON

DECLARE @ys money
SELECT @ys = CAST((z.NoPayMoney + isnull(m.NoPayMoney,0)) AS MONEY) FROM tblXskpMain m left join
(SELECT StaffID,sum(NoPayMoney) NoPayMoney FROM tblXskpMain
WHERE RatifyFlag<>'n' and NoPayMoney<>0 and StaffID is not null group by StaffID) z on m.StaffID=z.StaffID

SELECT m.xskpno as 单据号,c.cusno as 客商编号,c.cusname as 客商名称,f.staffno as 职员编号,f.staffname as 职员名称,
CASE WHEN (m.KPDate < c.HTStartDate or m.KPDate > c.HTEndDate) then '合同超期' ELSE '通过' END AS 合同超期标志,
CASE WHEN @ys > f.SaleLimit then '员工销售限额超出' ELSE '通过' END AS 员工销售限额超出标志,
CASE WHEN M.PayDate < GETDATE() then '客商应收超期' ELSE '通过' END AS 客商应收超期标志,
CASE WHEN S.PRICE < K.MinBulkPrice THEN '单价低入最小批发价' ELSE '通过' END AS 限价标志
FROM tblXskpMain m inner join
tblXskpSub s ON m.XSKPNo=s.XSKPNo left join
tblstock k on s.stkid=k.id left join
tblclient c on m.cusid=c.id left join
tblstaff f on m.OperatorNo=f.staffno
WHERE m.RatifyFlag = 'N'

搜索更多相关主题的帖子: SQL CODE 
2007-09-30 12:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-174275-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014502 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved