7

I have following code to filter out rows on a column that is null and it is working

->addFieldToFilter(
            'ep_image',
            ['null' => true]
       )

and I have another code to filter out rows on a column that is not null which is not working

->addFieldToFilter(
            'ep_image',
            ['notnull' => true]
       )

Can anyone help me out on how to filter not null values?

Also tried array('notnull' => true)and array('null' => false), but none working.

13

You can try this

->addFieldToFilter(
            'ep_image',
            ['neq' => 'NULL']
       )
  • 2
    Thanks @userpk, that worked!!! Above code mentioned by me also worked, the issue was due to same variable being used by two different code. – Nausif Feb 10 '17 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.