Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

SQL join 2 date tables

$
0
0

Hi,

I am attempting to join 2 header tables "receipt" and "plan" at date (receiptdate=date)

I'm not getting an output and I suspect a join issue - any ideas:

SELECT dbo.tbReceipt.ReceiptDate, dbo.tbReceiptLine.ReceiptQty, dbo.Plan_Line.Quantity
FROM     dbo.tbReceipt INNER JOIN
                  dbo.tbReceiptLine ON dbo.tbReceipt.PKId = dbo.tbReceiptLine.ReceiptId INNER JOIN
                  dbo.[Plan] INNER JOIN
                  dbo.Plan_Line ON dbo.[Plan].PKId = dbo.Plan_Line.PlanId ON dbo.tbReceipt.ReceiptDate = dbo.[Plan].Date
GROUP BY dbo.tbReceipt.ReceiptDate, dbo.tbReceiptLine.ReceiptQty, dbo.Plan_Line.Quantity


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>