Class or filter expression on date field in shapefile
efujioka at DUKE.EDU
Mon Oct 29 18:34:58 EDT 2007
I'm having difficulty in trying to filter features in a shapefile by dates.
I looked into this mailing list and have found a post saying "MapServer
doesn't support date types in shapefiles."
This post is a very old one, dated in July 2000.
So I'm wondering if the latest Mapserver supports this. And if so, what
is the date format for class/filter expression?
I use Mapserver 4.2.
Giving up using the date type field, I converted the date field to a
string or numeric field and was only successful with a numeric field
(e.g. 20030101 for 2003-03-01).
Can't I use a string value like '2003-03-01' for date comparison?
I tried the following expression but failed.
EXPRESSION ([DATE_S] > '2003-01-01')
Is there any smarter way to filter on dates?
Here is the snippet of the working mapfile with a numeric date field
NAME "MY SHAPEFILE"
EXPRESSION ([DATE_I] > 20030101 AND [DATE_I] < 20030201)
COLOR 255 0 0
OUTLINECOLOR 255 0 0
efujioka at duke.edu
More information about the mapserver-users