Don't know if the mapserver operators will deal with dates or not, but in your postgis DATA string, you can include the following: "now() as current_date" in order to provide you with the current_date.
If mapserver does not evaluate dates properly, you could opt to do the comparison in the DATA query as well, and simply return a "t" or "f" , i.e.: "(now() > startdate) as old", and then your expression reads: EXPRESSION "[old] = 'f'" And EXPRESSION "[old] = 't'" HTH, r.b. Robert W. Burgholzer Surface Water Modeler Office of Water Supply and Planning Virginia Department of Environmental Quality [EMAIL PROTECTED] 804-698-4405 Open Source Modeling Tools: http://sourceforge.net/projects/npsource/ -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, June 06, 2008 9:06 AM To: [email protected] Subject: [mapserver-users] compare date in class Hi list! I'd like to ask you if there is a way to compare a field date (mm-gg-yyyy) coming from a PostGIS query with the current date. (and above all how to get the current date ....) My goal is to use a point layer with different colours depending on expression result in the 'class' block. Ex: CONNECTION 'dbname=xxxx user=username password=password host=localhost' DATA 'the_geom from (select the_geom, id, oid, ...., start_date from table) as foo' ..... CLASS EXPRESSION (current_date > start_date) NAME "red" TEXT ([id]) STYLE COLOR 255 0 0 OUTLINECOLOR 0 0 0 END .... Thanks in advance Vinc _______________________________________________ mapserver-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapserver-users _______________________________________________ mapserver-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapserver-users
