|
SELECT Sheet1.客户单位, Sheet1.年份, IIf([时间]>#12/30/1899# And [时间]<#12/30/1899 8:0:0#,"零时班",IIf([时间]>#12/30/1899 7:59:59# And [时间]<#12/30/1899 16:0:0#,"日班","夜班")) AS 班别, Sum(Sheet1.发瓶数) AS 发瓶数之Sum, Sum(Sheet1.回瓶数) AS 回瓶数之Sum, Sum(Sheet1.自备瓶数) AS 自备瓶数之Sum, Sum(Sheet1.空瓶数) AS 空瓶数之Sum, Sum(Sheet1.退满瓶数) AS 退满瓶数之Sum, Sum(Sheet1.待检瓶数) AS 待检瓶数之Sum, Sum(Sheet1.送检瓶数) AS 送检瓶数之Sum, Sum(Sheet1.待修瓶数) AS 待修瓶数之Sum, Sum(Sheet1.报废瓶数) AS 报废瓶数之Sum, Sum(Sheet1.丢失瓶数) AS 丢失瓶数之Sum, Sum(Sheet1.走车瓶数) AS 走车瓶数之Sum, Sum(Sheet1.坏瓶阀数) AS 坏瓶阀数之Sum, Sum(Sheet1.少瓶阀数) AS 少瓶阀数之Sum, Sum(Sheet1.少瓶圈数) AS 少瓶圈数之Sum, Sum(Sheet1.少配件数) AS 少配件数之Sum
FROM Sheet1
GROUP BY Sheet1.客户单位, Sheet1.年份, IIf([时间]>#12/30/1899# And [时间]<#12/30/1899 8:0:0#,"零时班",IIf([时间]>#12/30/1899 7:59:59# And [时间]<#12/30/1899 16:0:0#,"日班","夜班"));
|
|