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
Auto populating fields
USB device in VMware
Transpose Columns Names with Data
Unable to install nVidia Display driver
Error printing report
Disable "Printed Date" in Outlook when printing
SQL Server BIT field true and false
Tooltips in .Net treeview
Outlook 2003 and Outlook 2007 - No options to accept, decline nor tentative for invitations
Windows XP SP2