date in ymd format php teradata converting date to character format in sql