|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
In the design view, Click on the Totals and select the Max function of the desired field(s).
|
|
#3
|
|||
|
|||
|
Quote:
I tried using total query. Access forces me to use aggregate function on every field which won't work for me. any other idea? |
|
#4
|
|||
|
|||
|
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.
|
|
#5
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > want select query to return largest value from each group |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|