I have the following code, can somoene tell me what I did wrong? Thanks in advance. Select ProfitLoss, Name, DatePosition FROM interestprofit Where Security = '13508754' And TraderName = 'CAN' GROUP BY TraderName, Security Having DatePosition IN (Select DatePosition FROM interestprofit WHERE DatePosition = MAX(DatePosition))