以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  大家来找茬  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=120008)

--  作者:yetle
--  发布时间: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 发货 
 f rom  PQ_OutID A 
 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\'

--  作者:有点甜
--  发布时间:2018/6/5 16:12:00
--  

使用fill直接得到表格

 

http://www.foxtable.com/webhelp/scr/1777.htm

 


--  作者:yetle
--  发布时间:2018/6/6 10:25:00
--  
你好,fill的方法用了,假如我只将黄色代码部分fill进去,表格只显示黄色代码数据,假如我将整个代码fill进去,筛选的时候还是会出现错误。
--  作者:有点甜
--  发布时间:2018/6/6 10:36:00
--  

1、查询表不能用loadfilter和load;

 

2、如果要筛选,请使用filter,如 http://www.foxtable.com/webhelp/scr/1432.htm