N
Newbie
Hi,
I want to be able to limit the records returned to only customers where
records have been returned. i.e if there are no NetSalesValue records for
the customer I don't want it to appear on the report.
Any ideas how I can do this?
The query I have so far is:
PARAMETERS [forms]![frmSalesDates]![txtDateEnd] DateTime;
TRANSFORM Sum(Round([NetSalesValue],0)) AS Expr2
SELECT dbo_ArTrnDetail.Customer, ArCustomer.Name, dbo_ArTrnDetail.StockCode,
Round(Abs(Sum(([InvoiceDate]>=DateAdd("yyyy",-1,forms!frmSalesDates!txtDateE
nd) And [InvoiceDate]<=forms!frmSalesDates!txtDateEnd)*[NetSalesValue])),0)
AS [Total Sales]
FROM dbo_ArTrnDetail INNER JOIN ArCustomer ON dbo_ArTrnDetail.Customer =
ArCustomer.Customer
WHERE (((dbo_ArTrnDetail.StockCode)<>"") AND
((Sum(Round([NetSalesValue],0)))<>0))
GROUP BY dbo_ArTrnDetail.Customer, ArCustomer.Name,
dbo_ArTrnDetail.StockCode
PIVOT "Mth" & DateDiff("m",[InvoiceDate],forms!frmSalesDates!txtDateEnd) In
("Mth0","Mth1","Mth2","Mth3","Mth4","Mth5","Mth6","Mth7","Mth8","Mth9","Mth1
0","Mth11");
Thanks
I want to be able to limit the records returned to only customers where
records have been returned. i.e if there are no NetSalesValue records for
the customer I don't want it to appear on the report.
Any ideas how I can do this?
The query I have so far is:
PARAMETERS [forms]![frmSalesDates]![txtDateEnd] DateTime;
TRANSFORM Sum(Round([NetSalesValue],0)) AS Expr2
SELECT dbo_ArTrnDetail.Customer, ArCustomer.Name, dbo_ArTrnDetail.StockCode,
Round(Abs(Sum(([InvoiceDate]>=DateAdd("yyyy",-1,forms!frmSalesDates!txtDateE
nd) And [InvoiceDate]<=forms!frmSalesDates!txtDateEnd)*[NetSalesValue])),0)
AS [Total Sales]
FROM dbo_ArTrnDetail INNER JOIN ArCustomer ON dbo_ArTrnDetail.Customer =
ArCustomer.Customer
WHERE (((dbo_ArTrnDetail.StockCode)<>"") AND
((Sum(Round([NetSalesValue],0)))<>0))
GROUP BY dbo_ArTrnDetail.Customer, ArCustomer.Name,
dbo_ArTrnDetail.StockCode
PIVOT "Mth" & DateDiff("m",[InvoiceDate],forms!frmSalesDates!txtDateEnd) In
("Mth0","Mth1","Mth2","Mth3","Mth4","Mth5","Mth6","Mth7","Mth8","Mth9","Mth1
0","Mth11");
Thanks