Fixed a bug for the DATE datatype (Ramana's change).