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
Update Pivot Table Based On Cell Reference - Error Handling
UNION all view % is not updatable because a partitioning column was not found
getting error message when download offline address book
Conversion failed when converting date and/or time from character string.
.net User Control Events
Using =Sumif in excel to calculate costs between two dates across different sheets
Text Cursor Starts At Top of Page in Microsoft Office 2003
Windows 7 Licensing
Windows Home Server Activation
Convert a DataReader to a DataSet