請幫助我,下面是我的sql查詢。當我執行它時,結果是什麼都沒有。SQL Server加入3表
SELECT tblclientinfo.acctnum,
tblclientinfo.fname,
tblclientinfo.fname,
tblreservation.unitnum,
tblbillingsched.billnum,
tblbillingsched.duedate,
tblbillingsched.monthlyamort,
tblbillingsched.totalbalance
FROM tblclientinfo
JOIN tblreservation
ON tblclientinfo.acctnum = tblreservation.reservationnum
JOIN tblbillingsched
ON tblreservation.reservationnum = tblbillingsched.accountnum
WHERE tblbillingsched.accountnum = 'C0000000021'
AND tblbillingsched.duedate BETWEEN '1/1/2014' AND '1/30/2014'
這裏是我的表:
tblClientInfo, pk = acctNum
tblReservation, pk = ReservationNum, fk = accountNum
tblBillingSched, pk = ID, fk = accountNum
您確定您的數據符合這些過濾條件嗎? – Shawn
感謝你們的及時回覆,但結果仍然是空的。我仔細檢查每個表,他們都有數據。我認爲我的PK和FK是問題,但我不知道如何解決它。請看我的桌子關係圖。 [鏈接](http://farm6.staticflickr.com/5520/9950519065_06207ec31e_z.jpg) – Sishan