views:

48

answers:

1

Using Access Database

Table

ID Time

001 100000
001 100005
001 103000
001 102500
001 110000
001 120000
001 113000
...,

From the above table, i want to take first four time

Query like

Select id, min(time) from table group by id

I want to take first four min(time) for each person

Expected Output

ID Time

    001 100000
    001 100005
    001 102500
    001 103000
    002
    ...,

How to make a query for this condition?

+1  A: 

Take a look at this KB article on grouping and top N functions in access. You might have to tweak your table structure slightly but it will set you on the right track

http://support.microsoft.com/kb/153747

Kevin Ross