Need help for a query

D

Denise

I'm trying to create a report from a query that would give me a list of
companies with their maximum stock price and lowest stock price for the month
grouped by month and sorted by company name. I have been able to group it
and sort it, but unable to get the maximum and minimum stock price for the
month. It list all the prices for the entire month. Can someone please help.
 
K

karl dewey

Try this ---
SELECT Format([Sale Month Date], "yyyy mmm") AS Sale_Month, [company name],
Max([Sale Price]) AS Max_Price, Min([Sale Price]) AS Min_Price
FROM YourTable
GROUP BY Format([Sale Month Date], "yyyymm"), [company name]
ORDER BY Format([Sale Month Date];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top