Foxtable(狐表)用户栏目专家坐堂 → [求助]同样的SQL语句,在查询表里可以执行,但在代码中不执行


  共有68人关注过本帖树形打印复制链接

主题:[求助]同样的SQL语句,在查询表里可以执行,但在代码中不执行

帅哥哟,离线,有人找我吗?
2900819580
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1366 积分:9977 威望:0 精华:0 注册:2015/6/30 8:46:00
[求助]同样的SQL语句,在查询表里可以执行,但在代码中不执行  发帖心情 Post By:2025/1/14 16:45:00 [显示全部帖子]

sel ect v.FNumber, v.FModel, v.FName, v.CDate, v.MDate, v.Qty ,v.NDayS,Case when V.Ndays >= 365 then '1年以上' when V.Ndays >= 30 and V.Ndays < 365 then '1' when V.Ndays > 0 then '1' when V.Ndays IS null then '呆滞' end as Lx From (SEL ECT FNumber, FModel, FName, CDate, MDate, Qty, DATEDIFF(DAY, MDate, CDate) AS NDayS FROM (SEL ECT w.FItemID, w.FNumber, w.FModel, w.FName, GETDATE() AS CDate, (SEL ECT MAX(FDate) AS Expr1 FROM (SELE CT a.FItemID, b.FDate, a.FInterID FROM {ICStockBillEntry} AS a LEFT OUTER JOIN {ICStockBill} AS b ON a.FInterID = b.FInterID) AS c WHERE (FItemID = w.FItemID)) AS MDate,(SE LECT TOP (1) FQty FROM {ICInventory} AS K WHERE (FItemID = w.FItemID)) AS Qty FROM {t_ICItemCore} AS w ) AS J) as V order by v.FNumber


语句内容如上,不知那里出问题了。


此主题相关图片如下:微信截图_202501141637551.png
按此在新窗口浏览图片


此主题相关图片如下:微信截图_20250114163834.png
按此在新窗口浏览图片

此主题相关图片如下:微信截图_20250114164044.png
按此在新窗口浏览图片



 回到顶部