• Or like this?

    --select the grandmax of the max of three columns

    DECLARE @date1Max AS datetime = (SELECT MAX([orderdate])

    FROM [Sales].[OrderValues]);

    DECLARE @date2Max AS datetime = (SELECT MAX([requireddate])

    FROM [Sales].[OrderValues]);

    DECLARE @date3Max AS datetime = (SELECT MAX([shippeddate])

    FROM [Sales].[OrderValues]);

    --SELECT @date1Max AS orderdate, @date2Max AS requireddate , @date3Max AS shippeddate; --TO CHECK CORRECT DATE

    SELECT CASE

    WHEN @date1Max >= @date2Max AND @date1Max >= @date2Max THEN @date1Max

    WHEN @date2Max >= @date1Max AND @date1Max >= @date3Max THEN @date2Max

    ELSE @date3Max

    END AS GrandMax;