Added a check for date type when comparing by string.