PARAMETERS [Forms]![窗体1]![dDate1] DateTime, [Forms]![窗体1]![dDate2] DateTime,[Forms]![窗体1]![Combo4] Text ( 255 );
TRANSFORM Sum(查询1.iQuantity) AS iQuantity之总计
SELECT 查询1.cInvAddCode
FROM 查询1
WHERE (((查询1.dDate) Between [Forms]![窗体1]![dDate1] And [Forms]![窗体1]![dDate2]) AND ((查询1.cInvAddCode)=[Forms]![窗体1]![Combo4]))
GROUP BY 查询1.cInvAddCode
PIVOT 查询1.dDate;
select 计划1.dDate,计划1.cInvAddCode,计划1.iQuantity,("计划" & 计划1.iGrade) as 计划 From 计划1
union all
select 计划2.dDate,计划2.cInvAddCode,计划2.iQuantity,("计划" & 计划2.iGrade) as 计划 From 计划2
union all
select 计划3.dDate,计划3.cInvAddCode,计划3.iQuantity,("计划" & 计划3.iGrade) as 计划 From 计划3
union all
select 计划4.dDate,计划4.cInvAddCode,计划4.iQuantity,("计划" & 计划4.iGrade) as 计划 From 计划4
UNION ALL select 计划5.dDate,计划5.cInvAddCode,计划5.iQuantity,("计划" & 计划5.iGrade) as 计划 From 计划5;