Compare data between 2 rows of same table
Based on your requirement if both columns are in the same table we could use ISNULL to achieve this output?

e.g.

select ISNULL(date2, date1) as CalcDate
from &lt;table&gt;


Results:

CalcDate
2017-03-06 17:02:00.000
2017-02-17 11:20:00.000
2017-03-13 17:07:00.000
2017-03-17 12:05:00.000
2017-01-24 11:45:00.000