# Cannot Search/Filter for Date

**URL:** https://discuss.elastic.co/t/cannot-search-filter-for-date/129834
**Category:** Kibana
**Created:** [April 27, 2018, 12:54pm UTC](https://discuss.elastic.co/t/cannot-search-filter-for-date/129834 "2018-04-27T12:54:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mmethe](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@mmethe](https://discuss.elastic.co/u/mmethe)
#### Post date: [April 27, 2018, 12:54pm UTC](https://discuss.elastic.co/t/cannot-search-filter-for-date/129834/1 "2018-04-27T12:54:51Z")

</div>

I use JDBC to grab sql data and put into elastic search. I can the data in kibana but I cannot filter on a date field, clsddate.

input:  
input {  
jdbc {  
jdbc\_driver\_library =\> "/etc/logstash/drivers/mssql-jdbc-6.2.2.jre8.jar"  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
jdbc\_connection\_string =\> "jdbc:sqlserver://brt1-trackit01\brt1trackit01;databaseName=TRACKIT8\_DATA2"  
jdbc\_user =\> "reports"  
jdbc\_password =\> "letmeinNOW!"  
schedule =\> "0 \* \* \* \*"  
statement =\> "SELECT \* FROM tasks WHERE MODIDATE \>= :sql\_last\_value"  
}  
}

NO FILTER

Output:  
output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
sniffing =\> true  
manage\_template =\> false  
user =\> elastic  
password =\> letmein  
index =\> "tasks-%{+YYYY.MM.dd}"  
}  
}

in Kibana, when I query **clsddate: -** , I get:  
Discover: [parsing\_exception] [match\_phrase] unknown token [VALUE\_NULL] after [query], with { line=1 & col=667 }

Error: [parsing\_exception] [match\_phrase] unknown token [VALUE\_NULL] after [query], with { line=1 & col=667 }  
at respond ([http://brt1-elk02/bundles/vendors.bundle.js?v=16627:143:161556](http://brt1-elk02/bundles/vendors.bundle.js?v=16627:143:161556))  
at checkRespForFailure ([http://brt1-elk02/bundles/vendors.bundle.js?v=16627:143:160796](http://brt1-elk02/bundles/vendors.bundle.js?v=16627:143:160796))  
at [http://brt1-elk02/bundles/vendors.bundle.js?v=16627:137:20984](http://brt1-elk02/bundles/vendors.bundle.js?v=16627:137:20984)  
at processQueue ([http://brt1-elk02/bundles/vendors.bundle.js?v=16627:116:132456](http://brt1-elk02/bundles/vendors.bundle.js?v=16627:116:132456))  
at [http://brt1-elk02/bundles/vendors.bundle.js?v=16627:116:133349](http://brt1-elk02/bundles/vendors.bundle.js?v=16627:116:133349)  
at Scope.$digest ([http://brt1-elk02/bundles/vendors.bundle.js?v=16627:116:144239](http://brt1-elk02/bundles/vendors.bundle.js?v=16627:116:144239))  
at Scope.$apply ([http://brt1-elk02/bundles/vendors.bundle.js?v=16627:116:147018](http://brt1-elk02/bundles/vendors.bundle.js?v=16627:116:147018))  
at done ([http://brt1-elk02/bundles/vendors.bundle.js?v=16627:116:100026](http://brt1-elk02/bundles/vendors.bundle.js?v=16627:116:100026))  
at completeRequest ([http://brt1-elk02/bundles/vendors.bundle.js?v=16627:116:104697](http://brt1-elk02/bundles/vendors.bundle.js?v=16627:116:104697))  
at XMLHttpRequest.xhr.onload ([http://brt1-elk02/bundles/vendors.bundle.js?v=16627:116:105435](http://brt1-elk02/bundles/vendors.bundle.js?v=16627:116:105435))

When I view a record in kibana, if clsddate is not populated, there is a '-' in the field.

What do I need to do to be able to query on this date field?

Thanks!  
-Mike M

---

<div class="post-metadata">

### Author: ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)
#### Post date: [April 27, 2018, 1:13pm UTC](https://discuss.elastic.co/t/cannot-search-filter-for-date/129834/2 "2018-04-27T13:13:49Z")

</div>

Hi Mike,

the `-` is just a representation that there is no value for that field. If you want to query whether a field has a value, you can just use the filter bar to create an `field exists` or `field does not exist` filter. That way you will filter for those documents.

Hope that solved your issue.

Cheers,  
Tim

---

<div class="post-metadata">

### Author: ![mmethe](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@mmethe](https://discuss.elastic.co/u/mmethe)
#### Post date: [April 27, 2018, 1:43pm UTC](https://discuss.elastic.co/t/cannot-search-filter-for-date/129834/3 "2018-04-27T13:43:52Z")

</div>

Thank You!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 25, 2018, 1:43pm UTC](https://discuss.elastic.co/t/cannot-search-filter-for-date/129834/4 "2018-05-25T13:43:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
