Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 28th, 2004, 12:33 AM
di_cheung di_cheung is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 di_cheung User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
want select query to return largest value from each group

Hi. I have a table that has 9 fields. One of them is indexed and duplicates
allowed. there is also a date field, and a time field. I want the select query
to group by the indexed field and return the record (from each group) that
has the latest date and time.

any help would be appreciated.

-di

Reply With Quote
  #2  
Old July 28th, 2004, 04:58 AM
ineuw ineuw is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 82 ineuw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 28 sec
Reputation Power: 5
In the design view, Click on the Totals and select the Max function of the desired field(s).

Reply With Quote
  #3  
Old July 28th, 2004, 07:56 PM
di_cheung di_cheung is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 di_cheung User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by ineuw
In the design view, Click on the Totals and select the Max function of the desired field(s).

I tried using total query. Access forces me to use aggregate function on every field which won't work for me.
any other idea?

Reply With Quote
  #4  
Old July 29th, 2004, 06:36 AM
ineuw ineuw is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 82 ineuw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 28 sec
Reputation Power: 5
Sorry I missed your reply. I understand your problem but study the numerous options of the aggregate query. If you stilll wish to pursue the issue, you can email me a sample database and a short description of which field values you need (and which you don't) I will gladly help.

Reply With Quote
  #5  
Old August 3rd, 2004, 12:22 AM
di_cheung di_cheung is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 di_cheung User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I appreciate your willingness to help. I solved the problem already.

putting the date and time field separately is actually a bad idea. So
I run a query to put them together (so Max() works). then I use two
queries, one to get the latest date, one to get all the other fields to
show. so that did it.

-di

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > want select query to return largest value from each group


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT