This is what the actual sql statement looks like. All the final query
looks
like is a display of the fields from the FIRST TABLE in the statement,
then
it will repeat (as row records) all duplicate stores with their data, but
that data is not under a correct field. I wrongly assumed a UNION ALL
QUERY
would create proper fields for each and every table in the query.
I dont see where this UNION ALL will help me compile a report.
SELECT [IBC], [Store], [Location], [City], [Zip], [DP Acct], [1Q DP 20oz],
[Coke Acct], [1Q Coke], [Pepsi Acct], [1Q non carb], [1Q aquafina], [Pepsi
EC
Payment 1], [NCI Acct], [1Q NCI]
FROM [2008 Houston Table]
UNION ALL SELECT [IBC], [Store], [Location], [City], [Zip], [Shelves],
[Ozarka Payment 1], [Ozarka Payment], Null, Null, Null, Null, Null, Null,
Null
FROM [Ozarka HOU Rebate Query];
UNION ALL
SELECT [IBC], [Store], [Location], [City], [Zip], [Yumi Acct], [1Q Yumi],
[Yumi Rebate], Null, Null, Null, Null, Null, Null, Null
FROM [Yumi HOU Rebate Query]
UNION ALL
SELECT [IBC], [Store], [Location], [City], [Zip], [Frito Acct], [1Q
Frito],
[Frito Rebate], [Frito Growth], Null, Null, Null, Null, Null, Null
FROM [Frito Lay Hou Rebate Query]
UNION ALL SELECT [IBC], [Store], [Location], [City], [Zip], [Milk Acct],
[1Q
Gal], [1Q Pint], [Gal Rebate], [Pint Rebate], Null, Null, Null, Null, Null
FROM [IBC Milk HOU Rebate Query];
ftwguy said:
Can anyone tell me what is wrong with this SQL for a UNION ALL. What I
end
up with is a query that only shows the fields from the very First table
in
the list. I also get input boxes asking for parameter value for STORE,
MILK
GAL, MILK PINT.
I'm using 5 tables. 4 of the tables were built from previous queries.