|
本帖最后由 koutx 于 2010-5-14 09:08 编辑
第一个查询:qry出库1:
SELECT tbl出库.提柜人 AS 姓名, Sum(IIf([提柜地点]="DCW",1,0)+IIf([还柜地点]="DCW",1,0))/2 AS 大铲湾
FROM tbl出库
GROUP BY tbl出库.提柜人
HAVING (((Sum(IIf([提柜地点]="DCW",1,0)+IIf([还柜地点]="DCW",1,0))/2)>0))
ORDER BY tbl出库.提柜人;
第二个查询:qry出库2:
SELECT tbl出库.还柜人 AS 姓名, Sum(IIf([提柜地点]="DCW",1,0)+IIf([还柜地点]="DCW",1,0))/2 AS 大铲湾
FROM tbl出库
GROUP BY tbl出库.还柜人
HAVING (((Sum(IIf([提柜地点]="DCW",1,0)+IIf([还柜地点]="DCW",1,0))/2)>0));
联合查询:
SELECT 姓名, 大铲湾
FROM qry出库1
UNION ALL SELECT 姓名, 大铲湾
FROM qry出库2; |
|