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
Displaying list data in a Microsoft Report Viewer control
Installing Exchange 2007 Managment Tools on Windows 7
Select query
Royal Flush Browser Test
How do I fix App log Event id 1202 warning. 0x534 error (Windows 2000 Server)?
Can a Dell XP Home reinstallation cd for a PC be used for reinstallation of XP Home on Dell laptop without having any issues?
TC5730 Thin Client WES 2009 Terminal Services 2008 Single Sign On issue (0x507?)
Difficulty uploading items larger than 1 MB
.NET MySQL question
TextBox and Validation Rule