barbarossaii
Master of Disaster
- Local time
- Today, 18:54
- Joined
- Dec 28, 2002
- Messages
- 70
Hi,
is it possible to Group and THEN select the top records from a table ?
I got a tbl like this:
Group....Month....Prt-No....Qty
a..............Jan.......a1..........1
a..............Jan.......a1..........2
a..............Jan.......a1..........3
a..............Jan.......a1..........4
a..............Feb.......a1..........1
a..............Feb.......a1..........2
a..............Feb.......a1..........3
a..............Feb.......a1..........5
a..............Jan.......a2..........1
a..............Jan.......a2..........2
a..............Jan.......a2..........34
a..............Jan.......a2..........4
a..............Feb.......a2..........4
a..............Feb.......a2..........3
a..............Feb.......a2..........2
a..............Feb.......a2..........1
b..............Jan.......b1..........1
b..............Jan.......b1..........2
b..............Jan.......b1..........3
b..............Jan.......b1..........4
I'd like to get the top 3 records for every Group & Month.
The desired result would be:
a..............Jan.......a1..........2
a..............Jan.......a1..........3
a..............Jan.......a1..........4
a..............Feb.......a1..........2
a..............Feb.......a1..........3
a..............Feb.......a1..........5
a..............Jan.......a2..........2
a..............Jan.......a2..........34
a..............Jan.......a2..........4
a..............Feb.......a2..........4
a..............Feb.......a2..........3
a..............Feb.......a2..........2
b..............Jan.......b1..........2
b..............Jan.......b1..........3
b..............Jan.......b1..........4
The number of records per Group/Month combination may differ.
I wasn't able to do this via TOP-function or Group-funktion. I either got a error message or the querry simply selected the top3 records (regardles the month or group).
Is there a way to do this "newbie-style" ?
(i.e. in the design view / without vba,...)
TIA,
Barbarossa II
is it possible to Group and THEN select the top records from a table ?
I got a tbl like this:
Group....Month....Prt-No....Qty
a..............Jan.......a1..........1
a..............Jan.......a1..........2
a..............Jan.......a1..........3
a..............Jan.......a1..........4
a..............Feb.......a1..........1
a..............Feb.......a1..........2
a..............Feb.......a1..........3
a..............Feb.......a1..........5
a..............Jan.......a2..........1
a..............Jan.......a2..........2
a..............Jan.......a2..........34
a..............Jan.......a2..........4
a..............Feb.......a2..........4
a..............Feb.......a2..........3
a..............Feb.......a2..........2
a..............Feb.......a2..........1
b..............Jan.......b1..........1
b..............Jan.......b1..........2
b..............Jan.......b1..........3
b..............Jan.......b1..........4
I'd like to get the top 3 records for every Group & Month.
The desired result would be:
a..............Jan.......a1..........2
a..............Jan.......a1..........3
a..............Jan.......a1..........4
a..............Feb.......a1..........2
a..............Feb.......a1..........3
a..............Feb.......a1..........5
a..............Jan.......a2..........2
a..............Jan.......a2..........34
a..............Jan.......a2..........4
a..............Feb.......a2..........4
a..............Feb.......a2..........3
a..............Feb.......a2..........2
b..............Jan.......b1..........2
b..............Jan.......b1..........3
b..............Jan.......b1..........4
The number of records per Group/Month combination may differ.
I wasn't able to do this via TOP-function or Group-funktion. I either got a error message or the querry simply selected the top3 records (regardles the month or group).
Is there a way to do this "newbie-style" ?
(i.e. in the design view / without vba,...)
TIA,
Barbarossa II