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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the highest value

Status
Not open for further replies.

mama16

MIS
Oct 22, 2004
125
US
Hello, I need to create a query that will give me the highest and lowest value. For example

25666
25999
26000
24000
22222
45000
10000

How can I have Access to pick 45000 and also pick 10000?
Any ideas?
 
Check out Access help for the Min and Max functions:
Code:
SELECT Max([YourfieldName]) As MaxYourFieldName......FROM YourTableName

I'm CosmoKramer, and I approve this message.
 
I want to get one highest value. I'm getting all the values. For exanple I get the data like this

56000
45265
41021
32000
22002

It's giving me the highest value on top and that;s good but I don't need Access to show the others, I want 56000 to show by itself along with the other values like

A 586956
B 626332
C 570000
D 562333

I did a grouping by but I still get all the values, highest value on top

Any ideas?

Thanks



 
Did you try the syntax I posted above??
Code:
SELECT Max([YourfieldName]) As MaxYourFieldName FROM YourTableName
This will return only one record, in this case the highest value of YourFieldName.

I'm CosmoKramer, and I approve this message.
 
mama16,

Do as Cosmokramer said - NO GROUPING. Incidentally if you want the min as well do


SELECT Max(YourTable.YourField) AS MaxOfField, Min(YourTable.YourField) as MinOfField
FROM YourTable;


Mordja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top