Max

mugman17

Registered User.
Local time
Today, 17:04
Joined
Nov 17, 2000
Messages
110
I want to find the maximum price between two dates. When I do this, I get the maximum price for each date within the two dates. I just want the highest price in the table within the two dates. How do I go about this?

Thanks in advance.
 
I guess you're using MAX(Price) and a Date column in your query.
That's the reason why you're getting more Max Prices as each combination of your Date column and price column is unique..

Either drop the Date column from your query or use a subquery.

Basic statement using a subquery:

SELECT YourDateColumn, Price
FROM YourTable
WHERE Price =
(SELECT Max(Price)
FROM YourTable AS YourTable1
WHERE YourTable1.YourDateColumn BETWEEN YourStartDate AND YourEndDate);

RV
 

Users who are viewing this thread

Back
Top Bottom