Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query that will select the max number

Status
Not open for further replies.

jorbroni

Technical User
Dec 5, 2002
24
US
I am trying to write a query in access using data that gives me:

The names of my clients
each division under their name
The cash flow for each division.

What I am trying to do is write a query that only gives me the division for each client that has the highest cash flow out of the group. I tried setting the client Name column to "group by", the division column to "group by", and the cash flow column to "max". That did not work.


Could someone guide me in the right direction.

Thanks
 
I think you would be better of using a report to group rather then a query and the DMax function to obtain the greatest cash flow. An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
I think it is easier if you write it in SQL

select max(cash_flow), division from table
order by cash_flow, division

Then I think you can choose the option to hide the cash flow column if you want to. Dodge20
If it ain't broke, don't fix it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top