Compare values in group on report

Auburnsp

New member
Local time
Today, 09:06
Joined
May 8, 2012
Messages
7
I have a database that contains departments, items and prices charged. Some departments have charged different prices for the same item. I need a report to show if a department has charged a different price than other departments for the same item.

Many departments charge for the same items and if they all charged the same amount I don't want them to appear on the report.

However - if 5 (or 20) departments charged for an item but one of those charged a different price - I need them all to show on the report.

Am I doomed?
 
Look at the attach picture to see the values in the table and the query result.
One way to do it is:
SELECT DISTINCT DepartmentItemPrice.Department, DepartmentItemPrice.ItemName, DepartmentItemPrice.Price
FROM DepartmentItemPrice INNER JOIN DepartmentItemPrice AS DepartmentItemPrice_1 ON DepartmentItemPrice.ItemName = DepartmentItemPrice_1.ItemName
WHERE (([DepartmentItemPrice]![Price]<>[DepartmentItemPrice_1]![Price]))
ORDER BY DepartmentItemPrice.ItemName;
 

Attachments

  • Dep.jpg
    Dep.jpg
    47.8 KB · Views: 96

Users who are viewing this thread

Back
Top Bottom