[英]MSAccess subdatasheet
I have an Access query, listing invoices and related items in subdatasheet:我有一个访问查询,在子数据表中列出发票和相关项目:
SELECT DISTINCTROW OutgoingInvoice.InvoiceID, OutgoingInvoice.Sum, OutgoingInvoice.Complete, Sum(Products.IncomingSUM) AS [Sum Of Products_SUM], [OutgoingInvoice].[Sum]-[Sum Of Products_SUM] AS Különbözet, OutgoingInvoice.Note, OutgoingInvoice.ID
FROM OutgoingInvoice INNER JOIN Products ON OutgoingInvoice.[ID] = Products.[OutgoingInvoice]
GROUP BY OutgoingInvoice.InvoiceID, OutgoingInvoice.Sum, OutgoingInvoice.Complete, OutgoingInvoice.Note, OutgoingInvoice.ID;
The problem, that invoices without items not shown:问题是没有显示项目的发票:
How can I manage to display all the rows from OutgoingInvoice (even if they do not have joined subitem)
如何设法显示 OutgoingInvoice 中的所有行(即使它们没有加入子项)
SELECT OutgoingInvoice.InvoiceID,
OutgoingInvoice.Sum,
OutgoingInvoice.Complete,
Sum(Products.IncomingSUM) AS [Sum Of Products_SUM],
[OutgoingInvoice].[Sum]-[Sum Of Products_SUM] AS Különbözet,
OutgoingInvoice.Note,
OutgoingInvoice.ID
FROM OutgoingInvoice
LEFT JOIN Products ON OutgoingInvoice.[ID] = Products.[OutgoingInvoice]
GROUP BY OutgoingInvoice.InvoiceID,
OutgoingInvoice.Sum,
OutgoingInvoice.Complete,
OutgoingInvoice.Note,
OutgoingInvoice.ID;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.