From 01acc490a9a6a615153333238ae874c419ed24ec Mon Sep 17 00:00:00 2001 From: "jitendra.purohit@webaccessglobal.com" Date: Thu, 24 Jul 2014 14:07:24 +0530 Subject: [PATCH] Empty check for datetime field --- CRM/Contact/BAO/Query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 9dc6990f5e..2f813833d4 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -5151,11 +5151,11 @@ SELECT COUNT( conts.total_amount ) as cancel_count, return $clause; case 'IS EMPTY': - $clause = " ( $field IS NULL OR $field = '' ) "; + $clause = " (NULLIF($field, '') IS NULL) "; return $clause; case 'IS NOT EMPTY': - $clause = " ( $field IS NOT NULL AND $field <> '' ) "; + $clause = " (NULLIF($field, '') IS NOT NULL) "; return $clause; case 'IN': -- 2.25.1