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

Showing Largest And Smallest and Max in Access

Status
Not open for further replies.

sap1958

Technical User
Oct 22, 2009
138
US
I need to also do the following in MS Access (using Access2003)

1. Show largest gift transaction and the date
2. Show the smallest gift transaction and the date
3. Show the first gift transaction and the date
4. show the last gift transaction and date

I have the giftid, giftamount and giftdate as parameters
 
Try something like:
Code:
SELECT *
FROM transactions
WHERE 
GiftID = (SELECT TOP 1 GiftID
 FROM Transactions
 ORDER BY GiftAmount DESC, GiftID)
OR
GiftID = (SELECT TOP 1 GiftID
 FROM Transactions
 ORDER BY GiftAmount, GiftID)
OR
GiftDate = (SELECT Max(GiftDate)
 FROM Transactions)
OR
GiftDate = (SELECT Min(GiftDate)
 FROM Transactions)



Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top