How do I combine these two tables so that all columns and rows from each show up? I'm expecting the resulting output to be 5 columns (based on the header names after the AS command).Query 1:SELECT FSE_HistoryInventoryMove.TransactionDate AS 'AdjDate', FSE_HistoryInventoryMove.InventoryQuantity*-1 AS 'AdjQty', FSE_HistoryInventoryMove.AvailabilityDate AS 'UseBy', FSE_HistoryInventoryMove.LotNumberFrom AS 'Lot#'FROM BIReports.dbo.FSE_HistoryInventoryMove FSE_HistoryInventoryMoveWHERE (FSE_HistoryInventoryMove.ItemNumber='600128') AND (FSE_HistoryInventoryMove.BinFrom='v10259')UNIONSELECT FSE_HistoryInventoryMove.TransactionDate AS 'AdjDate', FSE_HistoryInventoryMove.InventoryQuantity AS 'AdjQty', FSE_HistoryInventoryMove.AvailabilityDate AS 'UseBy', FSE_HistoryInventoryMove.LotNumberTo AS 'Lot#'FROM BIReports.dbo.FSE_HistoryInventoryMove FSE_HistoryInventoryMoveWHERE (FSE_HistoryInventoryMove.ItemNumber='600128') AND (FSE_HistoryInventoryMove.BinTo='v10259')
Query 2:SELECT FSE_HistoryInventoryAdjustment.TransactionDate AS 'AdjDate',AdjQty = CASE FSE_HistoryInventoryAdjustment.ActionCodeWHEN '-' THEN (FSE_HistoryInventoryAdjustment.AdjustmentQuantity*-1) WHEN '+' THEN (FSE_HistoryInventoryAdjustment.AdjustmentQuantity) END, FSE_LotTrace.AvailabilityDate AS 'UseBy',FSE_HistoryInventoryAdjustment.LotNumber AS 'Lot#',FSE_HistoryInventoryAdjustment.RemarkFROM BIReports.dbo.FSE_HistoryInventoryAdjustment FSE_HistoryInventoryAdjustment, BIReports.dbo.FSE_LotTrace FSE_LotTraceWHERE FSE_LotTrace.LotNumber = FSE_HistoryInventoryAdjustment.LotNumber AND ((FSE_HistoryInventoryAdjustment.ItemNumber='600128') AND (FSE_HistoryInventoryAdjustment.Bin='v10259'))
I then want to sort everything by the header "AdjDate".Thanks in advance for the help.