未从第二个表获取数据
''大家好 ''查询正在工作,但我没有从 BD 表( B_Detail )获取数据 ''我做错了什么......?
SELECT CM.CM_Date AS Cdate, CM.C_MemoNo AS CmNo,0 as BookDate, 0 as LR_No,
CM.CM_Total as CMAmt, 0 as Amt_Rcvd, 0 as ChqDDNo, 0 as ChqDDdate, 0 as Acc_Typ,
0 as RcptNo,0 as MemoNo, 0 as M_Date, CM.CNee as conName
from (CMemo as CM
INNER JOIN ClientLedger ON (ClientLedger.CName = CM.CNee))
UNION ALL
Select 0 as Rcpt_Date, 0 as CmNo, BD.Bdate as BookDate, BD.BNo as LR_No,
0 as CM_Total, 0 as Amt_Rcvd, 0 as ChqDDNo, 0 as ChqDDdate, 0 as Acc_Typ,
0 as RcptNo,BD.CST as MNo, BD.GRDate as M_Date, BD.Consignee
from (B_Detail BD
INNER JOIN Receipt_CLNT CM ON (CM.CNee = BD.Consignee))
UNION ALL
SELECT Receipt_CLNT.Rcpt_Date, 0 as CmNo, 0 as BookDate, 0 as LR_No,
0 as CM_Total, Receipt_CLNT.Amt_Rcvd as RcptAmt,Receipt_CLNT.ChqDDNo as RefNo,
Receipt_CLNT.ChqDDdate as RefDate, Receipt_CLNT.Amt_Mode as Mode,
Receipt_CLNT.RcptNo as RcptNo, 0 as MemoNo, 0 as MDate, Receipt_CLNT.G_Name
from Receipt_CLNT
ORDER BY Cdate;
''hi all
''query is working but i am not getting data from BD table ( B_Detail )
''What am i doing wrong..??
SELECT CM.CM_Date AS Cdate, CM.C_MemoNo AS CmNo,0 as BookDate, 0 as LR_No,
CM.CM_Total as CMAmt, 0 as Amt_Rcvd, 0 as ChqDDNo, 0 as ChqDDdate, 0 as Acc_Typ,
0 as RcptNo,0 as MemoNo, 0 as M_Date, CM.CNee as conName
from (CMemo as CM
INNER JOIN ClientLedger ON (ClientLedger.CName = CM.CNee))
UNION ALL
Select 0 as Rcpt_Date, 0 as CmNo, BD.Bdate as BookDate, BD.BNo as LR_No,
0 as CM_Total, 0 as Amt_Rcvd, 0 as ChqDDNo, 0 as ChqDDdate, 0 as Acc_Typ,
0 as RcptNo,BD.CST as MNo, BD.GRDate as M_Date, BD.Consignee
from (B_Detail BD
INNER JOIN Receipt_CLNT CM ON (CM.CNee = BD.Consignee))
UNION ALL
SELECT Receipt_CLNT.Rcpt_Date, 0 as CmNo, 0 as BookDate, 0 as LR_No,
0 as CM_Total, Receipt_CLNT.Amt_Rcvd as RcptAmt,Receipt_CLNT.ChqDDNo as RefNo,
Receipt_CLNT.ChqDDdate as RefDate, Receipt_CLNT.Amt_Mode as Mode,
Receipt_CLNT.RcptNo as RcptNo, 0 as MemoNo, 0 as MDate, Receipt_CLNT.G_Name
from Receipt_CLNT
ORDER BY Cdate;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果将问题简化为仅问题部分,它仍然不返回数据吗?
如果是这样,则连接(作为内部连接)不匹配任何键。
CM.CNee = BD.收货人
If you simplify the question to just the problem part does it still not return data?
If so then the join (being an inner join) is not matching any keys.
CM.CNee = BD.Consignee