Once again, it's been awhile since I used SQL, so I'm sorry. I did search the forum first but I haven't found exactly what I'm looking for.
Here's a sample of my data in my CASH table:
TransID EmpID Amount Date
3 7 45 4/11/2007
4 7 45 2/2/2007
5 8 12 1/5/2007
6 7 30 6/12/2007
7 3 170
8 8 10 3/6/2007
I'm trying to pull the MAX(amount) for each EmpID. I also need the TransID and Date of those associated transactions. In the case of a tie for the amount (EmpID 7 with amount 45), I need it to pull the transaction with the most recent date (some don't have dates). Here's what I would like:
TransID EmpID Amount Date
3 7 45 4/11/2007
5 8 12 1/5/2007
7 3 170
Thanks for any ideas!
Here's a sample of my data in my CASH table:
TransID EmpID Amount Date
3 7 45 4/11/2007
4 7 45 2/2/2007
5 8 12 1/5/2007
6 7 30 6/12/2007
7 3 170
8 8 10 3/6/2007
I'm trying to pull the MAX(amount) for each EmpID. I also need the TransID and Date of those associated transactions. In the case of a tie for the amount (EmpID 7 with amount 45), I need it to pull the transaction with the most recent date (some don't have dates). Here's what I would like:
TransID EmpID Amount Date
3 7 45 4/11/2007
5 8 12 1/5/2007
7 3 170
Thanks for any ideas!