加好友 发短信
等级:四尾狐
帖子:858
积分:6381
威望:0
精华:0
注册:2017/2/13 9:04:00
|
大家来找茬 Post By:2018/6/5 15:54:00 [显示全部帖子]
在sql 管理器查询数据正常,放在sql查询表也正常,但进行筛选和取消筛选的时候提示sql语句语法错误,sql语句如下: | (筛选条件肯定是对的,之前没加黄色部分的时候,都可以正常筛选) select a.WorkNo AS 车间,a.Outdate as 货期 ,E.Goods as 类别 , A.InDate AS 制单日期 , E.MakeGro as 生产班组,E.Gyno as 物供号,e.ClientOrderno AS 批次号,e.OrderNo as 订单号,E.ClientStyle as 客款号,a.Ftyno as 厂号,a.Goodsxl as 系列名,A.DJNO as 制单号,b.color as 颜色,b.SizeBi as 杯型,b.size2 as S_70,b.size3 as M_75,b.size4 as L_80,b.size5 as XL_85,b.size6 as XXL_90, (isnull(b.size2,0)+isnull(b.size3,0)+isnull(b.size4,0)+isnull(b.size5,0)+isnull(b.size6,0)) as 订单合计, (ISNULL(g.insize1,0)+ISNULL(g.insize2,0)+ISNULL(g.insize3,0)+ISNULL(g.insize4,0)+ISNULL(g.insize5,0)+ISNULL(g.insize6,0)) as 入库, (ISNULL(d.outsize1,0)+ISNULL(d.outsize2,0)+ISNULL(d.outsize3,0)+ISNULL(d.outsize4,0)+ISNULL(d.outsize5,0)+ISNULL(d.outsize6,0)) as 发货 Left join PQ_Out_List b on A.OUTID=B.UPID left join pq_main E ON B.Orderno=E.OrderNo left join PQ_Size_Color_Num F on E.id=F.upid left join BAI_FTYNO V ON E.Ftyno=V.Ftyno left join (select x.Orderno, x.ftyno,x.color,x.SizeBi,sum(case when inout=2 then isnull(Size1,0) else 0 end) as outsize1,sum(case when inout=2 then isnull(Size2,0) else 0 end) as outsize2, sum(case when inout=2 then isnull(Size3,0) else 0 end) as outsize3,sum(case when inout=2 then isnull(Size4,0) else 0 end) as outsize4,sum(case when inout=2 then isnull(Size5,0) else 0 end) as outsize5,sum(case when inout=2 then isnull(Size6,0) else 0 end) as outsize6 f rom Goods_SizeGroup_List x group by x.Orderno,x.ftyno,x.color,x.SizeBi) d on LTRIM(RTRIM(f.orderno))=LTRIM(RTRIM(d.orderno)) and LTRIM(RTRIM(f.ftyno))=LTRIM(RTRIM(d.ftyno)) and LTRIM(RTRIM(f.color))=LTRIM(RTRIM(d.color)) and ISNULL(f.sizebi,'')=ISNULL(d.sizebi,'') left join (select y.Orderno, y.ftyno,y.color,y.SizeBi,sum(case when inout=1 then isnull(Size1,0) else 0 end) as insize1,sum(case when inout=1 then isnull(Size2,0) else 0 end) as insize2,sum(case when inout=1 then isnull(Size3,0) else 0 end) as insize3,sum(case when inout=1 then isnull(Size4,0) else 0 end) as insize4,sum(case when inout=1 then isnull(Size5,0) else 0 end) as insize5, sum(case when inout=1 then isnull(Size6,0) else 0 end) as insize6 f rom Goods_SizeGroup_List y group by y.Orderno,y.ftyno,y.color,y.SizeBi) g on LTRIM(RTRIM(f.orderno))=LTRIM(RTRIM(g.orderno)) and LTRIM(RTRIM(f.ftyno))=LTRIM(RTRIM(g.ftyno)) and LTRIM(RTRIM(f.color))=LTRIM(RTRIM(g.color)) and ISNULL(f.sizebi,'')=ISNULL(g.sizebi,'') where A.InDate>'2017-12-31'
|
|