Hello all,

Need a little help as the 100 or so permutations I've tried still have not yielded satisfactory results. We've built a table where arrive time based on offices are being tracked. We've been able to count the number of arrive times by day of week and by office.
What we would like to do is pull up the expected arrive time based on the time, the number of occurances and the office name.
Here's what I've been able to do so far, but can't figure out how to pull the time based on a single office name and max number of occurances(or if two entries for the same office are the same to pull the earliest time)
Here's the code:
SELECT First(TimeIn) AS FirstTimeIn, Max(CountOfRecordID) AS MaxCountOfRecordID, Max(Office_Name) AS LocationID
FROM RuntimeAVG
WHERE DayofWeek='Friday' AND CountOfRecordID<>1
GROUP BY TimeIn, Office_Name
ORDER BY Max(Office_Name), Max(CountOfRecordID) DESC , First(TimeIn);

Here's the result and as you can see, almost there

FirstTimeIn MaxCountOfRecordID LocationID
06:30 7 Office 1
06:45 3 Office 1
07:15 7 Office 2
07:00 6 Office 2
07:30 6 Office 2
09:30 2 Office 3
10:00 2 Office 3
07:30 3 Office 4
08:15 3 Office 4
07:45 2 Office 4
08:00 2 Office 4
08:30 2 Office 4
09:15 2 Office 4
10:45 2 Office 4
05:45 5 Office 5
06:00 2 Office 5
Any help is greatly appreciated.