TA的每日心情 | 开心 2021-8-10 12:18 |
---|
签到天数: 251 天 [LV.8]以坛为家I
|
楼主 |
发表于 2022-4-9 20:42:39
|
显示全部楼层
针过跟踪对比,发现这条语句在sql2008r2可以运行,但是在sql2016以上版本运行会出错:
SELECT cTypeName,cVouchID,dVouchDate,cDwName, cSSName,cCode,cexch_name,iexchrate,cAuthID, case when cVouchType=N'48' then iAmount_f else -iAmount_f end as iAmount_f, case when cVouchType=N'48' then iAmount else -iAmount end as iAmount,cBankAccount, cNoteNo,cItemCode,cDepName,cPersonName , cOperator, cDigest, iID From Ap_CloseCust_R Where iPayForOther<>2 and bStartFlag=0 and (CASE WHEN cCancelMan is null THEN 1 ELSE 2 END) & 3<>0 and (CASE WHEN cCheckMan is null THEN 1 ELSE 2 END) & 3<>0 and (bSend+1) & 3<>0 Order By dVouchDate , cDwCode, CVouchType COMPUTE sum(case when cVouchType=N'48' then iAmount_f else -iAmount_f end), sum(case when cVouchType=N'48' then iAmount else -iAmount end)
各位大神请指教。
|
|