I have a table which has the results from various runs for an analysis. The tabel stores the rundate as datetime, with the analysis results.Some days the analysis will run multiple times and I need to get the most recent analysis result for each day. I have tried using the following, but if there are multiple loss values on a given date then it pulls both values.SELECT distinct (convert(VarChar(10),RunDate,111)) as Rundate, cast(Sum(Loss)/1e6 as int) as LossFROM tbl_Analysisgroup by rundateorder by rundate desc
How can I change the above to get just the most recent result on a date?ThxLH