CRM-13947: fix where clause condition

CRM-13947: fix where clause condition