All:

I have a client who owns/rents several hangars at an airport.

He wants to see which airplane frequents each of his 10 hangars the most over a 12-month period.

I have a Hangar log for that 12 month period. It consists of:

Hangar No.

Tail ID

Date

I have written the code to place each hangar in the proper order (1,2,3,4,5,etc.) each day, with the TailID but:

How do I count the occurrences of each TailID in a particular hangar, and order that list so that the top tailID for each hangar floats to the top? i.e. the top plane to visit hangar#1, Hangar#2, etc.

Some sort of recursive search/sort routine, where the plane with the most visits to a particular hangar in a year (by tailID) will be the only ones listed (for a total of 10)

Sample data:

1 - N3948576

2 - N4309385

3 - NS5930432

4 - .

5 - .

6 - . etc., etc., etc.

7 - .

8 - .

9 - .

10- .

NEXT DAY

1 - N4309385

2 - N3948576

3 - NS5930432

4 - .

5 - .

6 - . etc., etc., etc.

7 - .

8 - .

9 - .

10- .

NEXT DAY

and so on, and so forth...

each day could be totally different from the previous day

The FINAL report should only be 10 entries:

1 - N374764 (this plane had the most times in Hangar#1 for the entire year)

2 - NS6675753358 (this plane had the most times in Hangar#2 for the entire year)

3-10 same output as 1 & 2 but with different data

I don't know if I have explained this correctly, but I hope someone catches on to what I'm trying to accomplish.

As always, thanks in advance

Stymied in Stubenville