Bug report #7865

filtering shapefile layer through DATE column broken due to wrong date separator

Added by Mathieu Pellerin - nIRV almost 11 years ago. Updated almost 11 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:-
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:16740

Description

Under QGIS master, filtering a shapefile layer using a DATE attribute/column is broken, while it works perfectly under 1.8. It appears to be linked with the separator char used under QGIS master (which differs from QGIS 1.8)

Steps to reproduce under QGIS master:
1. Load bomb_extract.shp into a new project
2. Right click on bomb_extract layer, and click on the Filter... menu item
3. In the SQL where clause text box, click on the DATE field, and push on the 'All' button inside the Values section
(
) Notice how the value are shown using a '-' separator
4. Build a SQL where clause by double clicking on the DATE field, then the = button, then a date value within the Values list box (let's say we choose '1973-01-21')
5. Click on the OK button

The above filter will return zero value. If you go back and change the date separator to '/', the filter will work out and return the positive candidates.

It seems QGIS is using the wrong date separator to display date data under QGIS master. In QGIS 1.8, the separator is '/', which seems to be compatible with OGR, while under QGIS the separator is '-', which doesn't work with OGR.

It's a pretty big user experience regression.

bomb_extract.zip (76.2 KB) Mathieu Pellerin - nIRV, 2013-05-20 01:06 AM

Associated revisions

History

#1 Updated by Mathieu Pellerin - nIRV almost 11 years ago

The GDAL's shapefile page (http://www.gdal.org/ogr/drv_shapefile.html) mentions that the date field format is year/month/day.

#2 Updated by Jürgen Fischer almost 11 years ago

  • Status changed from Open to Closed

#3 Updated by Mathieu Pellerin - nIRV almost 11 years ago

Big thanks for this one.

Also available in: Atom PDF