I need to take four queries and make them into one table
This is what I get when I just do a simple select query.
I think this is what I want, but I’m receiving a error
The number of columns in the two selected tables or queries of a union query do not match[/]
This is my first time trying to put together a union query, and I have received a lot of help and training from this form, so I’m hoping someone will be about to help me with learn how to compile a union query.
Thanks for all your help and time
TCB
This is what I get when I just do a simple select query.
Code:
SELECT
Wholesale_Rank_qry_2.OMNI_Number,
Wholesale_Rank_qry_2.branch,
Wholesale_Rank_qry_2.branch_name,
Wholesale_Rank_qry_2.[Rank>],
Wholesale_Rank_qry_2.[0to5Rank],
Wholesale_Rank_qry_2.Star_Rating,
Table_Rank_qry_2.[Rank>],
Purchase_Rank_qry_2.[Rank>],
CUSB_Rank_qry_2.[Rank>]
FROM CUSB_Rank_qry_2 RIGHT JOIN (Purchase_Rank_qry_2 RIGHT JOIN (Table_Rank_qry_2 RIGHT JOIN Wholesale_Rank_qry_2 ON Table_Rank_qry_2.OMNI_Number = Wholesale_Rank_qry_2.OMNI_Number) ON Purchase_Rank_qry_2.OMNI_Number = Wholesale_Rank_qry_2.OMNI_Number) ON CUSB_Rank_qry_2.OMNI_Number = Wholesale_Rank_qry_2.OMNI_Number;
I think this is what I want, but I’m receiving a error
The number of columns in the two selected tables or queries of a union query do not match[/]
Code:
SELECT [OMNI_Number],[branch],[branch_name],[Rank>],[0to5Rank],[Star_Rating]
FROM [Wholesale_Rank_qry_2]
UNION ALL SELECT [Rank>]
FROM [Table_Rank_qry_2];
UNION ALL SELECT [Rank>]
FROM [Purchase_Rank_qry_2];
This is my first time trying to put together a union query, and I have received a lot of help and training from this form, so I’m hoping someone will be about to help me with learn how to compile a union query.
Thanks for all your help and time
TCB