[mapserver-users] Get current year in a CLASS EXPRESSION (mapfile)

wiltomap wiltoma at gmail.com
Wed Mar 23 03:17:19 PDT 2016


I have a mapfile defining a layer which is about leaks fixes on a drinking
water network.

I would like to write an EXPRESSION (inside a CLASS) to select all current
year operations. I rely upon a PostgreSQL/PostGIS table which is storing
leaks fixes dates in a DATE type field named "datinter" (format is
YYY-MM-DD). For certain reasons I won't explain here (depending on the
website general infrastructure), I can't add columns to the table to display
year from the datinter column. I need to do it into the EXPRESSION parameter
of my mapfile.

I have tried things like this :

CLASS
  NAME "2016"
  EXPRESSION ("[datinter]" > "2016-01-01")
  ...
END

This kind of expression does filter some of the table rows but mixes
different years... I don't understand what selection is made. Any idea on
how to write the expression to achieve what I need?

Thanks in advance!





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Get-current-year-in-a-CLASS-EXPRESSION-mapfile-tp5257968.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list