[Mapserver-users] Date comparison
Luz Brigitte
luzbrigitte at hotmail.com
Thu Mar 20 15:21:51 PST 2003
I have a problem when I´m trying to write a logical expression to filter
a postgres table based on a Date type field, for example : 28/02/2003.
I don´t sure, but I think that Mapserver don´t read date expression.
A part of my code in Mapserver is:
LAYER
NAME "Clientes"
STATUS DEFAULT
DATA "the_geom from (select the_geom, geoclientes.oid,
geoclientes.id, cliente.id_cliente, cliente.nit, contratos.vigencia,
contratos.fecha_final, contratos.fecha_inicial from geoclientes inner
join cliente on (geoclientes.id = cliente.id_cliente) inner join
contratos on (geoclientes.id = contratos.id_cliente)) as query"
TYPE POINT
CONNECTIONTYPE POSTGIS
CONNECTION "user=postgres dbname=namedb host=domain port=5432"
# CLASSITEM "fecha_final"
LABELITEM "ID"
LABELMAXSCALE 10000
CLASS
NAME "contratos vigencia de 0 2 meses"
# IN THE NEXT LINE I NEED TO DO COMPARISON WITH ACTUAL DATE -
fecha_final field.
EXPRESSION ('[fecha_inicial]' eq '01-02-2002')
# EXPRESSION ([fecha_final] - [fecha_inicial] > "365")
SYMBOL 7
COLOR 255 255 0
OUTLINECOLOR 153 153 0
SIZE 8
LABEL
TYPE TRUETYPE
FONT "Arialbold"
SIZE 8
POSITION AUTO
COLOR 0 0 0
OUTLINECOLOR 255 255 255
PARTIALS FALSE
END
END
END
How do I perform a value-like comparison with dates in Mapserver to make
queries.
Thanks a lot for your help.
Brigitte P.
More information about the MapServer-users
mailing list