DataBaseView : WhereClause : Filter by empty field

Bruno Leclerc
Kilo Expert

Hi,
In a custom database view I would like to get all entries where a certain field contains no value.
I haven't seen anything about it online...
I tried these three whereclause syntaxes but without success:
1: t.firstname='Bruno' && t.lastnameISEMPTY
2: t.firstname='Bruno' && t.lastname=''
3: t.firstname='Bruno' && t.lastname=""
( Assume that t is my table prefix )
Does anyone know a solution ?

1 ACCEPTED SOLUTION

Bruno Leclerc
Kilo Expert

According to the KB0719186 :

The whereclause is made to link two tables, not to filter ....

One have to use a query business rule which add the filter like this :

 

(function executeRule(current, previous /*null when async*/) {

current.addQuery('tr_lastnameISEMPTY');

})(current, previous);

And it works.

View solution in original post

1 REPLY 1

Bruno Leclerc
Kilo Expert

According to the KB0719186 :

The whereclause is made to link two tables, not to filter ....

One have to use a query business rule which add the filter like this :

 

(function executeRule(current, previous /*null when async*/) {

current.addQuery('tr_lastnameISEMPTY');

})(current, previous);

And it works.