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
Example SQL Select Statement VBA Code
Microsoft Office 2007 Enterprise continually tries to reinstall
setting up subdomain on IIS6
PHP SESSION doesn't pass value to sub or upper directory on Linux
Show / Hide command button?
Word 97 Toolbars Disappear
Link tables manager
How to add Exchange tabs in ADUC on Vista 64 bit.
Web service / ASP.net project structure
STOP: 0x0000007E (0xC0000420, xxxxxx) acpi.sys - address 83AB9717