Hi,
This is my first post but I've used your forum many times to get myself out of jams primarily by using the search function. I have a snag the search function hasn't been able to help me with so any direction or help you can provide would be tremendous.
I've wrote an access db for an appliance delivery company that tracks parts used, delivery charges, delivery driver, etc. This db is poplulated via a csv file that is sent from the company's vendor. I will explain why this is important in a moment. During validation I came across a snag that will be hard to explain so I'm attaching a screenshot of the query output and the code to help explain.
The query output in the screenshot has a count of each description grouped by driver. Each count is accurate except for the M100 count which is the company's internal code for delivery charge. Turns out the company only charges one delivery charge when mulitple items are delivered to the same address. The csv import however has a delivery charge for every item regardless of the address. Of course I have to iron out this little snag. My original though was to use a distinct count on the address field of the database which would eliminate multiple delivery charges to the same address. But this would throw off the count when the same part is used multiple times at the same address. Not good. So I would need to do a distinct count on address when the description is M100.
My question is that possible as the client wants this all on one report or will have to create a seperate report just for delivery charges where I can use a distinct count?
Here is the code for the query.
Any help or direction is appreciated as I'm truly stuck.
Regards,
Jason
This is my first post but I've used your forum many times to get myself out of jams primarily by using the search function. I have a snag the search function hasn't been able to help me with so any direction or help you can provide would be tremendous.
I've wrote an access db for an appliance delivery company that tracks parts used, delivery charges, delivery driver, etc. This db is poplulated via a csv file that is sent from the company's vendor. I will explain why this is important in a moment. During validation I came across a snag that will be hard to explain so I'm attaching a screenshot of the query output and the code to help explain.
The query output in the screenshot has a count of each description grouped by driver. Each count is accurate except for the M100 count which is the company's internal code for delivery charge. Turns out the company only charges one delivery charge when mulitple items are delivered to the same address. The csv import however has a delivery charge for every item regardless of the address. Of course I have to iron out this little snag. My original though was to use a distinct count on the address field of the database which would eliminate multiple delivery charges to the same address. But this would throw off the count when the same part is used multiple times at the same address. Not good. So I would need to do a distinct count on address when the description is M100.
My question is that possible as the client wants this all on one report or will have to create a seperate report just for delivery charges where I can use a distinct count?
Here is the code for the query.
Code:
SELECT Main.Driver, Main.Date, Main.Description, Count([MS revenue].Description) AS CountOfDescription, Sum([MS revenue].Cost) AS SumOfCost, [Employee Percentage].[Revenue Percentage], Sum([Employee Percentage]![Revenue Percentage]*[MS revenue]!Cost) AS [Employee Revenue], [MS revenue].Cost, [Employee Percentage].[Employee Number], [MS revenue].[M Code], Main.Rescheduled
FROM (Main INNER JOIN [MS revenue] ON Main.Description = [MS revenue].Description) INNER JOIN [Employee Percentage] ON Main.Driver = [Employee Percentage].Employee
GROUP BY Main.Driver, Main.Date, Main.Description, [Employee Percentage].[Revenue Percentage], [MS revenue].Cost, [Employee Percentage].[Employee Number], [MS revenue].[M Code], Main.Rescheduled
HAVING (((Main.Date) Between [Enter Start Date (12/1/09)] And [Enter End Date (1/1/10)]) AND ((Main.Rescheduled) Is Null) AND (([Main]![Driver]) Is Not Null))
ORDER BY Main.Driver, Main.Description;
Any help or direction is appreciated as I'm truly stuck.
Regards,
Jason