You are getting the MAX of a date column so the value returned must be either type date or NULL. You can't substitute a string where a date is expected. It would make far more sense to just return NULL from the database and then display a place-holder at the application level.