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
Debugging/Modifying VB Code for Macro in Excel
SMTP e-mailing queries
SQL Query
Outlook 2007 constantly asking for password in SBS 2008 domain
Drop down list to display two columns but only bring 1 value in
Exchange 2007 SP2 permission issues
Alternative to "Can Grow" Property
displaying fields total amount in textbox on form
need to convert the following from asp to asp.net
sql question