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
Outlook Express 6.0 Message display incorrect
FORM HIEGHT
Display data in Access 2007
requesting CSR certificate for Exchange 2007
Problems using varchar(max) in Query
SSRS export INTO Excel Tabbed Sheets?
Excel VLookup based on Duplicate values
convert date from visual basic to C#
what is the outlook history file called
ADOX Add Column Multi-Step OLE DB errors