DATEDIFF With CASE Statement blank
问题 I'm pulling some data in an SQL query to output to PHP as below. , DATEDIFF('d',Activity.CreatedOn, NOW()) As Dif , DATEDIFF('d',qSWxSRLastUpdated.MaxOfCreatedOn, NOW()) As LastUpd , FORMAT((qSWxSRLastUpdated.MaxOfCreatedOn), 'DD-MMM-YYYY') AS Start , FORMAT((Activity.CreatedOn), 'DD-MMM-YYYY') AS CreatedOn , DATEDIFF('d',(Select CASE WHEN Activity.CreatedOn > qSWxSRLastUpdated.MaxOfCreatedOn THEN Activity.CreatedOn ELSE qSWxSRLastUpdated.MaxOfCreatedOn END), NOW()) AS MostRecentDate Now the