Hi all
I have just created a really handy query that lists products sold by day (and time). My intention is to dump the list into a spreadsheet and do a pivot table to get some really useful sales information.
The query lists the following information:
Product Ref , Product Price , Quantity Ordered , Total Sales (Price * Qty Ordered), Date/Time of Sale (plus a couple of custom properties listing categories which I have removed from the query to simplify it whilst building).
However the figures are out by about 10% when comparing to the Actinic sales report. The Access query is always under. I'm obviously missing/excluding certain product/sales...
This is the SQL:
I've gone through it and I think I must be excluding a value from one of the following fields. I currently have the following set:
Order.Status = F
OrderDetail.Quantity Cancelled = 0
OrderDetail.nLineType = <>2
Order.bOrderIsDeleted = 0
Can anyone see what I might have missed to make the query match the Actinic Sales Report output.
Or can anyone confirm what values are contained in Order.Status, OrderDetail.nLineType, etc that I might need to include?
Any advice or pointers appreciated.
Paul
I have just created a really handy query that lists products sold by day (and time). My intention is to dump the list into a spreadsheet and do a pivot table to get some really useful sales information.
The query lists the following information:
Product Ref , Product Price , Quantity Ordered , Total Sales (Price * Qty Ordered), Date/Time of Sale (plus a couple of custom properties listing categories which I have removed from the query to simplify it whilst building).
However the figures are out by about 10% when comparing to the Actinic sales report. The Access query is always under. I'm obviously missing/excluding certain product/sales...
This is the SQL:
SELECT Product.[Product Reference], [Product.Price]/100*1.175 AS [Product-Price], OrderDetail.QuantityOrdered, Order.[Date Ordered]
FROM ([Order] INNER JOIN OrderDetail ON Order.[Order Sequence Number] = OrderDetail.OrderSequenceNumber) INNER JOIN Product ON OrderDetail.ProductReference = Product.[Product Reference]
WHERE ((([Product.Price]/100*1.175)<>0) AND ((Order.Status)="F") AND ((OrderDetail.QuantityCancelled)=0) AND ((Order.bOrderIsDeleted)=0) AND ((OrderDetail.nLineType)<>2));
FROM ([Order] INNER JOIN OrderDetail ON Order.[Order Sequence Number] = OrderDetail.OrderSequenceNumber) INNER JOIN Product ON OrderDetail.ProductReference = Product.[Product Reference]
WHERE ((([Product.Price]/100*1.175)<>0) AND ((Order.Status)="F") AND ((OrderDetail.QuantityCancelled)=0) AND ((Order.bOrderIsDeleted)=0) AND ((OrderDetail.nLineType)<>2));
Order.Status = F
OrderDetail.Quantity Cancelled = 0
OrderDetail.nLineType = <>2
Order.bOrderIsDeleted = 0
Can anyone see what I might have missed to make the query match the Actinic Sales Report output.
Or can anyone confirm what values are contained in Order.Status, OrderDetail.nLineType, etc that I might need to include?
Any advice or pointers appreciated.
Paul
Comment