Microsoft
Software
Hardware
Network
Question : Add Alias to Union query
I have the following union query:
SELECT ProductId, ProductCode, ProductDescription FROM qryProductsStockTakeAdjust
mentReport
UNION SELECT Ast, Desc FROM tblAsterisk
ORDER BY Productcode;
It does not run because the number of columns do not match. How do I add an alias to get the same numbe rof columns on each side?
Answer : Add Alias to Union query
For example, add Null:
SELECT ProductId, ProductCode, ProductDescription FROM qryProductsStockTakeAdjust
mentReport
UNION SELECT Ast, [Desc], Null FROM tblAsterisk
ORDER BY Productcode;
Note: DESC is a reserved keyword.
(°v°)
Random Solutions
Rules in error: Cannot remove messages from the folder.
Display localhost time
Applying Group Policies at any point of time
Access 2003 SQL Question
application_beginrequest
Export gridview to word and excel. ms word 2007 & excel 2007
how to join two unrelated queries together
Delegwiz deny mod?
Missing ActiveX Control ??
Script to automatically run the saved imports in an access database