fix the bug for null datetime field