Hi again,
I've looked at your method in more detail, however, I'm not sure that it
could work for my report.
For the report to work properly, I think I would have to remove the
'StoreName' field from the crosstab query, as I'm not sure how I could
successfully replace this with a null value.
I have listed the SQL code for both my base query and crosstab query. If
you have the time, please have a look at them for me and tell me what you
think I might be able to do.
qryEPOSSalesByProduct (base query):
SELECT tblEPOSSales.[D/S/S Department Code], tblEPOSSales.[D/S/S
Department
Description], tblEPOSSales.[D/S/S Section Code], tblEPOSSales.[D/S/S
Section
Description], tblEPOSSales.[D/S/S Sub Section Code], tblEPOSSales.[Sub
Section Description], tblEPOSSales.[CU Ean Code], tblEPOSSales.[CU
Description Food Database], tblEPOSSales.FullDescription, tblEPOSSales.[BS
Transaction Date], tblEPOSSales.[BIS Sales Quantity], tblEPOSSales.[BIS
Sales
Value], tblEPOSSales.[BIS Sales Vat], tblEPOSSales.[NET Sales ?],
tblDates.WeekNo, tblEPOSSales.Week, Format(Weekday([Date]),'dddd') AS
[Day],
tblEPOSSales.Buyer, tblEPOSSales.NSL, tblEPOSSales.[Store Ana Code],
tblStores.StoreName
FROM (tblDates INNER JOIN tblEPOSSales ON tblDates.Date = tblEPOSSales.[BS
Transaction Date]) INNER JOIN tblStores ON tblEPOSSales.[Store Ana Code] =
tblStores.StoreANA
WHERE (((tblEPOSSales.Buyer) Is Not Null));
qctbEPOSSalesByProductByWeekNo (crosstab query):
PARAMETERS Forms!frmEPOSReportDialogue!txtEndWeek Long;
TRANSFORM Sum(qryEPOSSalesByProduct.[BIS Sales Quantity]) AS [SumOfBIS
Sales
Quantity]
SELECT qryEPOSSalesByProduct.[D/S/S Department Code],
qryEPOSSalesByProduct.[D/S/S Section Description],
qryEPOSSalesByProduct.[Sub
Section Description], qryEPOSSalesByProduct.[D/S/S Section Code],
qryEPOSSalesByProduct.[D/S/S Sub Section Code],
qryEPOSSalesByProduct.[D/S/S
Department Description], qryEPOSSalesByProduct.Buyer,
qryEPOSSalesByProduct.[CU Ean Code],
qryEPOSSalesByProduct.FullDescription,
qryEPOSSalesByProduct.NSL, qryEPOSSalesByProduct.StoreName,
Sum(qryEPOSSalesByProduct.[NET Sales ?]) AS Cost,
Sum(qryEPOSSalesByProduct.[BIS Sales Quantity]) AS total,
Sum(qryEPOSSalesByProduct.[BIS Sales Value]) AS [Value]
FROM qryEPOSSalesByProduct
WHERE (((qryEPOSSalesByProduct.Week) Between
([Forms]![frmEPOSReportDialogue]![txtEndWeek]-6) And
[Forms]![frmEPOSReportDialogue]![txtEndWeek]))
GROUP BY qryEPOSSalesByProduct.[D/S/S Department Code],
qryEPOSSalesByProduct.[D/S/S Section Description],
qryEPOSSalesByProduct.[Sub
Section Description], qryEPOSSalesByProduct.[D/S/S Section Code],
qryEPOSSalesByProduct.[D/S/S Sub Section Code],
qryEPOSSalesByProduct.[D/S/S
Department Description], qryEPOSSalesByProduct.Buyer,
qryEPOSSalesByProduct.[CU Ean Code],
qryEPOSSalesByProduct.FullDescription,
qryEPOSSalesByProduct.NSL, qryEPOSSalesByProduct.StoreName
PIVOT "Wk" & ([Week]-[Forms]![frmEPOSReportDialogue]![txtEndWeek]) In
("Wk0","Wk-1","Wk-2","Wk-3","Wk-4","Wk-5");
Thanks again.
Regards,
Jedster
Alex Dybenko said:
Hi again,
i made a sample which shows technique i described:
http://www.pointltd.com/Downloads/Details.asp?dlID=45