我的写法,只有9条记录,查询出来81条了,应该怎么写才对? Post By:2021/8/3 13:24:00 [显示全部帖子]
s elect a.日期,c.客户名称,a.商品编号,b.条码,b.商品名称,b.规格,b.计量单位,a.数量,a.单价,a.金额,d.金额 as 成本,iif(a.金额 is null,0,a.金额)-iif(d.金额 is null,0,d.金额) as 毛利,iif(a.金额=0,0,(a.金额-d.金额)/a.金额) as 毛利率 from {销售} a,{商品档案} b,{客户档案} c,{出库} d where (a.单号=d.单号 and a.商品编号=d.商品编号) and a.客户编号=c.客户编号 and a.商品编号=b.商品编号 and a.日期>=#" & dtp1.value &"# And a.日期< #" & dtp2.value.adddays(1) &"#"