G
Gordon
I have a crosstab query which shows the number of orders for each product
over the past several weeks. The problem is that I want it to show the
results for all products, and not just the products that had orders. Right
now, it only shows the products that had orders. Is there a way to do this?
My SQL code is below.
TRANSFORM CLng(Nz(Sum([Sales By Product temp].Ordered),0)) AS SumOfOrdered
SELECT [Sales By Product temp].ShortSKU2, [Sales By Product temp].Product,
CLng(Nz(Sum([Sales By Product temp].Ordered),0)) AS [Total Of Ordered]
FROM [Sales By Product temp]
WHERE (((DateAdd("d",-Weekday([OrderDate],2)+1,[OrderDate])) Between Date()
And DateAdd("ww",-13,Date())))
GROUP BY [Sales By Product temp].ShortSKU2, [Sales By Product temp].Product
ORDER BY Format(DateAdd("d",-Weekday(OrderDate,2)+1,OrderDate),"mm/dd") DESC
PIVOT Format(DateAdd("d",-Weekday(OrderDate,2)+1,OrderDate),"mm/dd");
Thanks,
Gordon
over the past several weeks. The problem is that I want it to show the
results for all products, and not just the products that had orders. Right
now, it only shows the products that had orders. Is there a way to do this?
My SQL code is below.
TRANSFORM CLng(Nz(Sum([Sales By Product temp].Ordered),0)) AS SumOfOrdered
SELECT [Sales By Product temp].ShortSKU2, [Sales By Product temp].Product,
CLng(Nz(Sum([Sales By Product temp].Ordered),0)) AS [Total Of Ordered]
FROM [Sales By Product temp]
WHERE (((DateAdd("d",-Weekday([OrderDate],2)+1,[OrderDate])) Between Date()
And DateAdd("ww",-13,Date())))
GROUP BY [Sales By Product temp].ShortSKU2, [Sales By Product temp].Product
ORDER BY Format(DateAdd("d",-Weekday(OrderDate,2)+1,OrderDate),"mm/dd") DESC
PIVOT Format(DateAdd("d",-Weekday(OrderDate,2)+1,OrderDate),"mm/dd");
Thanks,
Gordon