请看以下语名:
s el ect 入库时间,{物料信息表}.产品名称,{物料信息表}.包装规格,{库存明细表1}.产品批号,{库存明细表1}.产品数量,piao面价,IIF(成本价> 0,ROUND(成本价 * {库存明细表1}.产品数量,2),ROUND(piao面价*{库存明细表1}.产品数量,2)) AS 库存金额,{库存明细表1}.仓库名称,{订单明细表}.外币,实收数量,{库存明细表1}.实收数量* IIF(成本价> 0,成本价,piao面价) as 仓库实收额,{订单主表}.总金额 as 订单总金额,{订单主表}._Identify as 订单编号,(s el ect Sum(报销金额) from {报销明细表} where {报销明细表}.编号标注 = {订单明细表}.订单编号 and 销售 = 0) as 采购费用 FROM ((({库存明细表1} INNER JOIN {物料信息表} ON {库存明细表1}.MID = {物料信息表}._Identify) INNER JOIN {订单明细表} ON {库存明细表1}.订单编号 = {订单明细表}._Identify) INNER JOIN {报销明细表} ON {订单明细表}.订单编号 = {报销明细表}.编号标注) INNER JOIN {订单主表} ON {订单明细表}.订单编号 = {订单主表}._Identify where {物料信息表}.所属公司 = 'ht' and {库存明细表1}.产品数量 > 0 ORDER BY 产品名称,入库时间
这个是不行的,但是如果我把这句拿出来:,{库存明细表1}.仓库名称 变成这样:
s el ect 入库时间,{物料信息表}.产品名称,{物料信息表}.包装规格,{库存明细表1}.产品批号,{库存明细表1}.产品数量,piao面价,IIF(成本价> 0,ROUND(成本价 * {库存明细表1}.产品数量,2),ROUND(piao面价*{库存明细表1}.产品数量,2)) AS 库存金额,{订单明细表}.外币,实收数量,{库存明细表1}.实收数量* IIF(成本价> 0,成本价,piao面价) as 仓库实收额,{订单主表}.总金额 as 订单总金额,{订单主表}._Identify as 订单编号,(s ele ct Sum(报销金额) from {报销明细表} where {报销明细表}.编号标注 = {订单明细表}.订单编号 and 销售 = 0) as 采购费用 FROM ((({库存明细表1} INNER JOIN {物料信息表} ON {库存明细表1}.MID = {物料信息表}._Identify) INNER JOIN {订单明细表} ON {库存明细表1}.订单编号 = {订单明细表}._Identify) INNER JOIN {报销明细表} ON {订单明细表}.订单编号 = {报销明细表}.编号标注) INNER JOIN {订单主表} ON {订单明细表}.订单编号 = {订单主表}._Identify where {物料信息表}.所属公司 = 'ht' and {库存明细表1}.产品数量 > 0 ORDER BY 产品名称,入库时间
这样就没有问题了。
或者把这句拿出来:,(s e lect Sum(报销金额) from {报销明细表} where {报销明细表}.编号标注 = {订单明细表}.订单编号 and 销售 = 0) as 采购费用 留下 :{库存明细表1}.仓库名称 也可以。
但是这两个列就不能放在一起,不然就不行?这是为什么啊?真想不通!