Query builder filtering dates null

Hello,

How can I filter in query builder where a date is null? 



Should I change the operators of the field?

Thank you

7 Replies 1 reply marked as answer

MK Mohan Kumar Ramasamy Syncfusion Team August 14, 2020 04:49 PM UTC

Hi Rafael, 
 
We have checked your reported query, we can achieve your requirement using operators field in column property. Please refer below code snippets. 
 
dateOperators = [ 
        { value: 'equal', key: 'Equal' }, 
        { value: 'isnull', key: 'Is Null' } 
    ]; 
             
            filter: ColumnsModel[] = [ 
        { 
            field:"EmployeeID", label:"Employee ID", type:"number" 
        }, 
        { 
           field:"FirstName", label:"First Name", type:"string" 
        }, 
        
        { field:"Title",label:"Title", type:"string" }, 
        { field:"HireDate", label:"Hire Date", type:"date" ,format:"dd/MM/yyyy", operators: this.dateOperators } 
    ]; 
             
            <div class="col-lg-12 control-section"> 
            <ejs-querybuilder #querybuilder class="row" width="70%" [columns]="filter" [dataSource]="dataSource" 
                        (created)="createdControl()"> 
             
            </ejs-querybuilder> 
</div> 
 
For your reference, we have prepared a sample based on this ,please refer below link. 
 
 
But currently Null value support not available in date type field, so we cannot generate predicate. 
 
Please let us know, if you need any further assistance. 
 
Regards, 
Mohankumar R 



RA Rafael August 14, 2020 05:26 PM UTC

Hello Mohankumar,

There's another way that I can make a custom filter to get where date is null? If don't do you have any plans to implement this?

Thank you


MK Mohan Kumar Ramasamy Syncfusion Team August 17, 2020 04:40 PM UTC

Hi Rafael, 
 
We have checked your reported requirement “Need to generate predicate for date type with null value”. And we would like to let you know that currently we are not having this support in our Querybuilder. However, we have considered this as a feature, and it will be available in any of our upcoming releases. You can track the status in the below feedback link. 
  

Regards, 
Mohankumar R 


Marked as answer

RA Rafael August 17, 2020 04:44 PM UTC

Hi Mohankumar,

Thank you very much, would be nice!





MK Mohan Kumar Ramasamy Syncfusion Team August 18, 2020 12:02 PM UTC

Hi Rafael, 
 
We have checked your reported link, it is getting opened correctly. There might have been network issues when you tried to open. Could you please check again. 
 
Regards, 
Mohankumar R  
 



RA Rafael August 18, 2020 01:04 PM UTC

Hi,

Now it's opening.

Thank you


MK Mohan Kumar Ramasamy Syncfusion Team August 19, 2020 07:48 AM UTC

Hi Rafael, 
 
Thanks for update. 
 
This fix will be available in any of our upcoming patch release. Until then we appreciate your patience. 
 
Regards, 
Mohankumar R 


Loader.
Up arrow icon