robertsquestion
Technical User
Hi,
I'm using Microsoft Access 2003 and got the following question.
Table T_Sales contains the following fields:
Customernr
Date
Sales
Now I'm looking for a query that gives me the 2 records (per customernr) that contain the largest sales.
So suppose the table contains (custnr, date, sales) the following:
1000, 01-01-2006, 500
1000, 02-01-2006, 900
1000, 03-01-2006, 200
2000, 01-01-2006, 850
2000, 02-01-2006, 600
2000, 03-01-2006, 900
The result of the query should be:
1000, 01-01-2006, 500
1000, 02-01-2006, 900
2000, 01-01-2006, 850
2000, 03-01-2006, 900
Does anyone know how to solve this in a query?
Thanks in advance for your help!
Robert
The Netherlands
I'm using Microsoft Access 2003 and got the following question.
Table T_Sales contains the following fields:
Customernr
Date
Sales
Now I'm looking for a query that gives me the 2 records (per customernr) that contain the largest sales.
So suppose the table contains (custnr, date, sales) the following:
1000, 01-01-2006, 500
1000, 02-01-2006, 900
1000, 03-01-2006, 200
2000, 01-01-2006, 850
2000, 02-01-2006, 600
2000, 03-01-2006, 900
The result of the query should be:
1000, 01-01-2006, 500
1000, 02-01-2006, 900
2000, 01-01-2006, 850
2000, 03-01-2006, 900
Does anyone know how to solve this in a query?
Thanks in advance for your help!
Robert
The Netherlands