A
Alex
I'm trying to create a union query with the following SQL. I keep getting a
parameter prompt for all the fields in the WHERE clause except for Model,
which correctly prompts me for Model#. Any ideas what I'm doing wrong?
Thanks.
SELECT [Model#],[Part#], [AS Part#], [Matl Code], [FIN WTLB], [Matl],
[Variable], [NPC], [MatlLB], [VarLB], [NPCLB]
FROM ExcelBRefParts
WHERE (([Model#]=[forms]![Rpt_NewCostRollupChange]![Model]) AND
ExcelBRefParts.[Matl Code]<>[ExcelB_Old].[Matl Code] OR (ExcelBRefParts.[FIN
WTLB]<>[ExcelB_Old].[FIN WTLB]) OR
(ExcelBRefParts.Matl<>[ExcelB_Old].[Matl]) OR
(ExcelBRefParts.Variable<>[ExcelB_Old].[Variable]) OR
(ExcelBRefParts.NPC<>[ExcelB_Old].[NPC]) OR
(ExcelBRefParts.MatlLB<>[ExcelB_Old].[MatlLB]) OR
(ExcelBRefParts.VarLB<>[ExcelB_Old].[VarLB]) OR
(ExcelBRefParts.NPCLB<>[ExcelB_Old].[NPCLB]));
UNION SELECT [Model#], [Part#], [AS Part#], [Matl Code], [FIN WTLB], [Matl],
[Variable], [NPC],[MatlLB],[VarLB], [NPCLB]
FROM ExcelB_Old
WHERE (([Model#]=[forms]![Rpt_NewCostRollupChange]![Model]) AND
ExcelBRefParts.[Matl Code]<>[ExcelB_Old].[Matl Code] OR (ExcelBRefParts.[FIN
WTLB]<>[ExcelB_Old].[FIN WTLB]) OR
(ExcelBRefParts.Matl<>[ExcelB_Old].[Matl]) OR
(ExcelBRefParts.Variable<>[ExcelB_Old].[Variable]) OR
(ExcelBRefParts.NPC<>[ExcelB_Old].[NPC]) OR
(ExcelBRefParts.MatlLB<>[ExcelB_Old].[MatlLB]) OR
(ExcelBRefParts.VarLB<>[ExcelB_Old].[VarLB]) OR
(ExcelBRefParts.NPCLB<>[ExcelB_Old].[NPCLB]));
parameter prompt for all the fields in the WHERE clause except for Model,
which correctly prompts me for Model#. Any ideas what I'm doing wrong?
Thanks.
SELECT [Model#],[Part#], [AS Part#], [Matl Code], [FIN WTLB], [Matl],
[Variable], [NPC], [MatlLB], [VarLB], [NPCLB]
FROM ExcelBRefParts
WHERE (([Model#]=[forms]![Rpt_NewCostRollupChange]![Model]) AND
ExcelBRefParts.[Matl Code]<>[ExcelB_Old].[Matl Code] OR (ExcelBRefParts.[FIN
WTLB]<>[ExcelB_Old].[FIN WTLB]) OR
(ExcelBRefParts.Matl<>[ExcelB_Old].[Matl]) OR
(ExcelBRefParts.Variable<>[ExcelB_Old].[Variable]) OR
(ExcelBRefParts.NPC<>[ExcelB_Old].[NPC]) OR
(ExcelBRefParts.MatlLB<>[ExcelB_Old].[MatlLB]) OR
(ExcelBRefParts.VarLB<>[ExcelB_Old].[VarLB]) OR
(ExcelBRefParts.NPCLB<>[ExcelB_Old].[NPCLB]));
UNION SELECT [Model#], [Part#], [AS Part#], [Matl Code], [FIN WTLB], [Matl],
[Variable], [NPC],[MatlLB],[VarLB], [NPCLB]
FROM ExcelB_Old
WHERE (([Model#]=[forms]![Rpt_NewCostRollupChange]![Model]) AND
ExcelBRefParts.[Matl Code]<>[ExcelB_Old].[Matl Code] OR (ExcelBRefParts.[FIN
WTLB]<>[ExcelB_Old].[FIN WTLB]) OR
(ExcelBRefParts.Matl<>[ExcelB_Old].[Matl]) OR
(ExcelBRefParts.Variable<>[ExcelB_Old].[Variable]) OR
(ExcelBRefParts.NPC<>[ExcelB_Old].[NPC]) OR
(ExcelBRefParts.MatlLB<>[ExcelB_Old].[MatlLB]) OR
(ExcelBRefParts.VarLB<>[ExcelB_Old].[VarLB]) OR
(ExcelBRefParts.NPCLB<>[ExcelB_Old].[NPCLB]));