Hi Everyone,
I'm trying to create a query that would query two table with some similar fields and a few unique one in one table. I was trying to create it by using "Union" but that was fruitless. Below is what I'm trying to accomplish.
I wrote this but it doesn't work:
SELECT [Year], [Version], TransactionID, EmployeeID, FirstName, LastName, OfficeCode, CostCenterNo, UpdateBy, UpdateDateTime, [RowVersion] FROM BudgetHeader WHERE (CostCenterNo = '38101') AND ([Year]='2015') UNION SELECT '2015' as [Year], '1' as [Version],'' as TransactionID,EmployeeID, FirstName, LastName, OfficeCode, CostCenterNo, UpdateBy, UpdateDateTime,[RowVersion] from Employee WHERE (CostCenterNo = '38101')