|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Top 3 query
Hi
I'm a newbie to access development. I have a table which lists records of employees monitoring. Each record has Id, date , name etc. What I want is, for any one month, to select three of the last records for all employees. So if employees have, say, six records I only want to display the last three of them (by date). I can work out most of the criteria to filter the records the way I want however I am not sure how to do this part of it. Can anyone help? Thanks in advance |
|
#2
|
|||
|
|||
|
use the dlast function in a bit of vb code to lookup the table row identifier of each of the last 3 records, e.g.
getkey = dlast("[keyfieldname]","[tablename]","criteria to be met") to get the last 3, you might wish to use a loop. You may also wish to use the dcount function to ensure that there is at least 3 records. If you need the exact code, then let me know the table definition. regards, Dan |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Top 3 query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|