|
5#
楼主 |
发表于 2006-8-21 19:15:00
|
只看该作者
以下是引用一点通在2006-8-21 10:11:00的发言:
查询出错,请按以下代码修改
SELECT DISTINCTROW [进出库 查询].货号, [进出库 查询].品名, [进出库 查询].规格, Sum([进出库 查询].入库数量) AS 入库数量总计, Sum([进出库 查询].入库金额) AS 入库金额总计, Sum([进出库 查询].出库数量) AS 出库数量总计, Sum([进出库 查询].出库金额) AS 出库金额总计, NZ([入库数量总计]-[出库数量总计]) AS 库存量, NZ([入库金额总计]-[出库金额总计]) AS 库存额, IIf([库存量]=0 Or [库存额]=0,0,[库存额]/[库存量]) AS 库存单价, Left([货号],2) AS 类别
FROM [进出库 查询]
GROUP BY [进出库 查询].货号, [进出库 查询].品名, [进出库 查询].规格
HAVING ((([进出库 查询].品名) Like IIf(IsNull([Forms]![入库录入]![品名]),"*","*" & [Forms]![入库录入]![品名] & "*")) AND (([进出库 查询].规格) Like IIf(IsNull([Forms]![入库录入]![规格]),"*","*" & [Forms]![入库录入]![规格] & "*")) AND ((Left([货号],2)) Like IIf(IsNull([Forms]![入库录入]![类别]),"*","*" & [Forms]![入库录入]![类别] & "*")));
改完后出现循环引用错误!查询结果是否与原来的联合查询结果一样,现在不知,---因运行不了! |
|