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
Forms: Conditional Formatting (when field Is Not Null) on Tab Stop
How to retrieve data from five different tables in Access database
421 4.2.1 unable to connect for some domains
SQL query
How do I check if a table exists, before creating the table...
Overcome Excel MAX num of nested if statement
Combining Cells
4 public folder instances remain after running moveallreplicas.ps1 How to remove or move?
using VCOPY
error 429 ActiveX component can't create object