Using the CASE statement, you get the job.
DECLARE @dates TABLE (mykey CHAR(10), date1 DATETIME, date2 DATETIME, date3 DATETIME) INSERT @dates VALUES ('Key1', '1/1/2015', '2/1/2015', '3/1/2105') INSERT @dates VALUES ('Key2', '1/2/2015', '4/2/2015', '3/2/2105') INSERT @dates VALUES ('Key3', '1/3/2016', '4/3/2015', '3/3/2105') select mykey, case when date1 >= date2 and date1 >= date3 THEN date1 when date2 >= date1 and date2 >= date3 then date2 else date3 end [LatestDate] from @dates
source share