在将 nvarchar 值 '58a661d35c7aed' 转换成数据类型 int 时失败。
金蝶云社区-云社区用户791S1234
云社区用户791S1234
0人赞赏了该文章 1,467次浏览 未经作者许可,禁止转载编辑于2017年03月21日 14:16:37
自定义的核算维度 查询多账簿核算维度余额表
INSERT INTO TMP878E0E5CFF0F11E6B164D632C41 (FBOOKID, FDATATYPE, FYEAR, FPERIOD, FDETAILID, FNUMBER, FDETAILNUMBER, FNAME, FDETAILNAME, FCURRENCYID, FCURRENCYNAME, FUNIT, FBEGINDEBITQTY, FBEGINDEBITPRICE, FBEGINDEBIT, FBEGINCREDITQTY, FBEGINCREDITPRICE, FBEGINCREDIT, FDEBITQTY, FDEBITPRICE, FDEBIT, FCREDITQTY, FCREDITPRICE, FCREDIT, FYTDDEBITQTY, FYTDDEBITPRICE, FYTDDEBIT, FYTDCREDITQTY, FYTDCREDITPRICE, FYTDCREDIT, FENDDEBITQTY, FENDDEBITPRICE, FENDDEBIT, FENDCREDITQTY, FENDCREDITPRICE, FENDCREDIT, FAMOUNTDIGITS, FUNITDIGITS, FPRICEDIGITS) SELECT b.FACCOUNTBOOKID, 0 fdatatype, b.FYEAR, b.FPERIOD, d.fid fdetailid, ISNULL(d.FNUMBER, ' ') fnumber, ISNULL(d.FNUMBER, ' ') fdetailnumber, ISNULL(d.FNAME, ' ') fname, ISNULL(d.FNAME, ' ') fdetailname, b.FCURRENCYID, CASE WHEN b.FCURRENCYID = 0 THEN '综合本位币' ELSE CONVERT(NVARCHAR(800), cyl.FNAME) END fcurrencyname, ' ' funit, CASE WHEN (SUM(ISNULL(b.FBEGINBALANCEFOR, 0)) > 0) THEN SUM(ISNULL(bqty.FBEGINQTY, 0)) ELSE 0 END fbegindebitqty, CASE WHEN CASE WHEN (SUM(ISNULL(b.FBEGINBALANCEFOR, 0)) > 0) THEN SUM(ISNULL(bqty.FBEGINQTY, 0)) ELSE 0 END = 0 THEN 0 ELSE (CONVERT(DECIMAL(23,10), CASE WHEN (SUM(ISNULL(b.FBEGINBALANCEFOR, 0)) > 0) THEN SUM(ISNULL(FBEGINBALANCEFOR, 0)) ELSE 0 END) / CONVERT(DECIMAL(23,10), CASE WHEN (SUM(ISNULL(b.FBEGINBALANCEFOR, 0)) > 0) THEN SUM(ISNULL(bqty.FBEGINQTY, 0)) ELSE 0 END)) END fbegindebitprice, CASE WHEN (SUM(ISNULL(b.FBEGINBALANCEFOR, 0)) > 0) THEN SUM(ISNULL(FBEGINBALANCEFOR, 0)) ELSE 0 END fbegindebit, CASE WHEN (SUM(ISNULL(b.FBEGINBALANCEFOR, 0)) < 0) THEN (-1 * SUM(ISNULL(bqty.FBEGINQTY, 0))) ELSE 0 END fbegincreditqty, CASE WHEN CASE WHEN (SUM(ISNULL(b.FBEGINBALANCEFOR, 0)) < 0) THEN (-1 * SUM(ISNULL(bqty.FBEGINQTY, 0))) ELSE 0 END = 0 THEN 0 ELSE (CONVERT(DECIMAL(23,10), CASE WHEN (SUM(ISNULL(b.FBEGINBALANCEFOR, 0)) < 0) THEN (-1 * SUM(ISNULL(FBEGINBALANCEFOR, 0))) ELSE 0 END) / CONVERT(DECIMAL(23,10), CASE WHEN (SUM(ISNULL(b.FBEGINBALANCEFOR, 0)) < 0) THEN (-1 * SUM(ISNULL(bqty.FBEGINQTY, 0))) ELSE 0 END)) END fbegincreditprice, CASE WHEN (SUM(ISNULL(b.FBEGINBALANCEFOR, 0)) < 0) THEN (-1 * SUM(ISNULL(FBEGINBALANCEFOR, 0))) ELSE 0 END fbegincredit, SUM(ISNULL(bqty.FDEBITQTY, 0)) fdebitqty, CASE WHEN SUM(ISNULL(bqty.FDEBITQTY, 0)) = 0 THEN 0 ELSE (CONVERT(DECIMAL(23,10), SUM(ISNULL(b.FDEBITFOR, 0))) / CONVERT(DECIMAL(23,10), SUM(ISNULL(bqty.FDEBITQTY, 0)))) END fdebitprice, SUM(ISNULL(b.FDEBITFOR, 0)) fdebit, SUM(ISNULL(bqty.FCREDITQTY, 0)) fcreditqty, CASE WHEN SUM(ISNULL(bqty.FCREDITQTY, 0)) = 0 THEN 0 ELSE (CONVERT(DECIMAL(23,10), SUM(ISNULL(b.FCREDITFOR, 0))) / CONVERT(DECIMAL(23,10), SUM(ISNULL(bqty.FCREDITQTY, 0)))) END fcreditprice, SUM(ISNULL(b.FCREDITFOR, 0)) fcredit, SUM(ISNULL(bqty.FYTDDEBITQTY, 0)) fytddebitqty, CASE WHEN SUM(ISNULL(bqty.FYTDDEBITQTY, 0)) = 0 THEN 0 ELSE (CONVERT(DECIMAL(23,10), SUM(ISNULL(b.FYTDDEBITFOR, 0))) / CONVERT(DECIMAL(23,10), SUM(ISNULL(bqty.FYTDDEBITQTY, 0)))) END fytddebitprice, SUM(ISNULL(b.FYTDDEBITFOR, 0)) fytddebit, SUM(ISNULL(bqty.FYTDCREDITQTY, 0)) fytdcreditqty, CASE WHEN SUM(ISNULL(bqty.FYTDCREDITQTY, 0)) = 0 THEN 0 ELSE (CONVERT(DECIMAL(23,10), SUM(ISNULL(b.FYTDCREDITFOR, 0))) / CONVERT(DECIMAL(23,10), SUM(ISNULL(bqty.FYTDCREDITQTY, 0)))) END fytdcreditprice, SUM(ISNULL(b.FYTDCREDITFOR, 0)) fytdcredit, CASE WHEN (SUM(ISNULL(b.FENDBALANCEFOR, 0)) > 0) THEN SUM(ISNULL(bqty.FENDQTY, 0)) ELSE 0 END fenddebitqty, CASE WHEN CASE WHEN (SUM(ISNULL(b.FENDBALANCEFOR, 0)) > 0) THEN SUM(ISNULL(bqty.FENDQTY, 0)) ELSE 0 END = 0 THEN 0 ELSE (CONVERT(DECIMAL(23,10), CASE WHEN (SUM(ISNULL(b.FENDBALANCEFOR, 0)) > 0) THEN SUM(ISNULL(FENDBALANCEFOR, 0)) ELSE 0 END) / CONVERT(DECIMAL(23,10), CASE WHEN (SUM(ISNULL(b.FENDBALANCEFOR, 0)) > 0) THEN SUM(ISNULL(bqty.FENDQTY, 0)) ELSE 0 END)) END fenddebitprice, CASE WHEN (SUM(ISNULL(b.FENDBALANCEFOR, 0)) > 0) THEN SUM(ISNULL(FENDBALANCEFOR, 0)) ELSE 0 END fenddebit, CASE WHEN (SUM(ISNULL(b.FBEGINBALANCEFOR, 0)) < 0) THEN (-1 * SUM(ISNULL(bqty.FENDQTY, 0))) ELSE 0 END fendcreditqty, CASE WHEN CASE WHEN (SUM(ISNULL(b.FBEGINBALANCEFOR, 0)) < 0) THEN (-1 * SUM(ISNULL(bqty.FENDQTY, 0))) ELSE 0 END = 0 THEN 0 ELSE (CONVERT(DECIMAL(23,10), CASE WHEN (SUM(ISNULL(b.FENDBALANCEFOR, 0)) < 0) THEN (-1 * SUM(ISNULL(FENDBALANCEFOR, 0))) ELSE 0 END) / CONVERT(DECIMAL(23,10), CASE WHEN (SUM(ISNULL(b.FBEGINBALANCEFOR, 0)) < 0) THEN (-1 * SUM(ISNULL(bqty.FENDQTY, 0))) ELSE 0 END)) END fendcreditprice, CASE WHEN (SUM(ISNULL(b.FENDBALANCEFOR, 0)) < 0) THEN (-1 * SUM(ISNULL(FENDBALANCEFOR, 0))) ELSE 0 END fendcredit, CASE WHEN b.FCURRENCYID = 0 THEN 0 ELSE ISNULL(c.FAMOUNTDIGITS, 2) END famountdigits, '0' funitdigits, c.FPRICEDIGITS fpricedigits FROM TMP878E0E60FF0F11E6B164D632C41 b LEFT OUTER JOIN TMP878E0E61FF0F11E6B164D632C41 bqty ON ((((((b.FACCOUNTBOOKID = bqty.FACCOUNTBOOKID AND b.FACCOUNTID = bqty.FACCOUNTID) AND b.FYEAR = bqty.FYear) AND b.FPERIOD = bqty.FPERIOD) AND b.FCURRENCYID = bqty.FCURRENCYID) AND b.FDETAILID = bqty.FDETAILID) AND b.FADJUSTPERIOD = bqty.FADJUSTPERIOD) LEFT OUTER JOIN T_BD_ACCOUNTBOOK bk ON b.FACCOUNTBOOKID = bk.fbookid LEFT OUTER JOIN T_BD_ACCOUNT a ON (b.faccountid = a.facctid AND bk.FACCTTABLEID = a.FACCTTBLID) LEFT OUTER JOIN T_BD_CURRENCY c ON c.FCURRENCYID = b.FCURRENCYID LEFT OUTER JOIN T_BD_CURRENCY_L cyl ON (c.FCURRENCYID = cyl.FCURRENCYID AND cyl.FLOCALEID = 2052) INNER JOIN #TM_GL_ACCOUNTITEMUSEDFLEX d ON (d.FDETAILID = b.FDETAILID AND d.FFLEXNUMBER = 'FF100002') INNER JOIN @FID_udt1 bks ON bks.FID = b.FACCOUNTBOOKID WHERE (((a.fnumber = '1604' OR (a.fnumber LIKE '1604.%')) AND (b.FYear = 2017 AND b.FPeriod = 1)) AND (b.FDETAILID <> 0)) GROUP BY b.FACCOUNTBOOKID, b.FYEAR, b.FPERIOD, d.FID, d.FNUMBER, d.FNAME, b.FCURRENCYID, cyl.FNAME, c.FAMOUNTDIGITS, c.FPRICEDIGITS
===================================================
调用堆栈:
在 Kingdee.BOS.App.Data.AbstractDatabase.ExecuteNonQuery(DbCommand command, IEnumerable`1 listParam)
在 Kingdee.BOS.App.Data.DBUtils.ExecuteBatch(Context ctx, List`1 lstSqlObj)
在 Kingdee.K3.FIN.GL.App.Report.MulBookFlexItemsBalanceService.GetReportData(Context ctx, MulBookFlexItemsBalanceFilterInfo filterInfo)
在 Kingdee.K3.FIN.GL.ServiceHelper.MulBookFlexItemsBalanceServiceHelper.GetReportData(Context ctx, MulBookFlexItemsBalanceFilterInfo filterInfo)
在 Kingdee.K3.FIN.GL.Report.PlugIn.BillReport.MulBookFlexItemsBalance.GetMulBookFlexItemsBalanceData()
在 Kingdee.K3.FIN.GL.Report.PlugIn.BillReport.MulBookFlexItemsBalance.BarItemClick(BarItemClickEventArgs e)
在 Kingdee.BOS.Core.DynamicForm.PlugIn.DynamicFormViewPlugInProxy.FireBarItemClick(BarItemClickEventArgs e)
在 Kingdee.BOS.Web.DynamicForm.DynamicWebFormView.BarItemClick(String parentKey, String barItemKey, BarDataManager bar, Int32 bartype)
在 Kingdee.BOS.Web.DynamicForm.DynamicWebFormView.MainBarItemClick(String barItemKey)
在 Kingdee.BOS.Web.DynamicForm.DynamicWebFormController.MainBarItemClick(String itemKey, JSONArray postDatas)

列表.jpg(83.00KB)