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 [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]Wholesale_Rank_qry_2.OMNI_Number, [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]Wholesale_Rank_qry_2.branch, [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]Wholesale_Rank_qry_2.branch_name, [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]Wholesale_Rank_qry_2.[Rank>], [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]Wholesale_Rank_qry_2.[0to5Rank], [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]Wholesale_Rank_qry_2.Star_Rating, [/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]Table_Rank_qry_2.[Rank>], [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]Purchase_Rank_qry_2.[Rank>], [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]CUSB_Rank_qry_2.[Rank>][/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]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][/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]FROM [Wholesale_Rank_qry_2][/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]UNION ALL SELECT [Rank>][/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]FROM [Table_Rank_qry_2];[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]UNION ALL SELECT [Rank>][/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]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