Bug report #10165
Cannot use "less than"/"greater than" operators on date fields
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||up/downstream|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||18619|
(This is a follow-up ticket of #9241)
There is an issue querying date fields: I cannot seem to use < and > operators in queries:
OGR error 1: Type mismatch or improper type of arguments to < operator.
#10 Updated by Matthias Kuhn over 8 years ago
- Status changed from Feedback to Closed
- Resolution set to up/downstream
I think you are referring to "Feature subset"?
That is passed to the provider and never evaluated by QGIS and therefore looks like an upstream issue.
You can try on the command line to find a syntax that works.
ogrinfo test2.shp -sql 'SELECT COUNT(*) FROM test2 WHERE DATE < "1970-01-01"' INFO: Open of `test2.shp' using driver `ESRI Shapefile' successful. Layer name: test2 Geometry: Point Feature Count: 1 Layer SRS WKT: (unknown) COUNT_*: Integer (0.0) OGRFeature(test2):0 COUNT_* (Integer) = 3
ogrinfo --version GDAL 1.10.1, released 2013/08/26
#12 Updated by Anita Graser over 8 years ago
- Subject changed from Cannot use "smaller than"/"bigger than" operators on date fields to Cannot use "less than"/"greater than" operators on date fields
This is the upstream ticket: http://trac.osgeo.org/gdal/ticket/5507
Not sure if this ticket here should be closed already as long as the upstream issue is not fixed?