Comparing min max values

jonmccracken

New member
Local time
Yesterday, 23:08
Joined
Jan 19, 2017
Messages
2
I ran a min max query to determine what products were purchased at the same price and what products were purchased at more than one price. I want to find products where the price fluctuated over time. There is a way to find these products, somehow using an example element in each field. such as x in the min field and not x in the max field. But I don't know how to write the example element.
This should be a very simple answer, I just can't seem to find it in any of the help pages.
 
Can you provide sample data? Include 2 sets:

A. Starting sample data from your table. Include table and field names and enough data to cover all cases.

B. Expected results of A. Based on feeding your query the data in A, show exactly what data you want it to return.

Use this format for posting data to a post:

TableNameHere
Field1Name, Field2Name, Field3Name, ...
Sally, 12/31/2016, 19
David, 12/1/2016, 33
Vince, 1/1/2017, 44
 
Here is the first table:
Item Search TAGItemDescr UnitPricePaid QuantityInv InvoiceDate InvoiceNumber 174006 $2,371.93 1 2/11/2016 A1122828 174006 $2,371.93 1 2/18/2016 A1126726 174006 $2,371.93 1 3/1/2016 A1133509 174006 $1,913.54 1 3/23/2016 A1147395 174006 $1,913.54 1 3/24/2016 A1148380 174006 $1,913.54 1 3/28/2016 A1150259 188316060 $200.00 1 2/12/2016 916028537 188316060 $200.00 1 2/12/2016 916028543 188316060 $200.00 1 2/25/2016 916094363

And here is the second, or answer table that I want to produce. The query returns only the TAGItemDescr values where there is a difference in price.
Item Search TAGItemDescr UnitPricePaid QuantityInv InvoiceDate InvoiceNumber 174006 $2,371.93 1 2/11/2016 A1122828 174006 $2,371.93 1 2/18/2016 A1126726 174006 $2,371.93 1 3/1/2016 A1133509 174006 $1,913.54 1 3/23/2016 A1147395 174006 $1,913.54 1 3/24/2016 A1148380 174006 $1,913.54 1 3/28/2016 A1150259
Thanks for your help!
Jon
 
You will need a sub-query--this is that SQL:

Code:
SELECT ItemSearch.TAGItemDescr
FROM ItemSearch
GROUP BY ItemSearch.TAGItemDescr
HAVING (((Max([UnitPricePaid])-Min([UnitPricePaid]))>0));

It gives you all the TAGItemDescr values that have UnitPricePaid differences. Save it, then build another query using it and [Item Search] to pull back full records.
 

Users who are viewing this thread

Back
Top Bottom