Query with dates in

Yewondwossen Assefa assefa at DMSOLUTIONS.CA
Mon Feb 28 15:52:30 EST 2005


To be able to do "real" time comparison, you need to enclose the field
and the value between backtics (something like (`[time_field]` eq
`2004-10-12`) should work. I think most of the common operators (if not
all) should work with time values.

Later,

Roberto Bianconi wrote:

>Hi,
>
>I have a shp file where data in the dbf associated are rows like this
>(field names in first row):
>
>CODE, BEGIN, END, VALUE
>A1, 2002-10-03T09:30:00, 2002-10-04T09:30:00, 60.
>A2, 2002-10-03T09:30:00, 2002-10-05T09:30:00, 60.
>
>Everything works if I just retrieve CODEs with:
>
>CLASS
>          SYMBOL "cross"
>          EXPRESSION ([VALUE] > 50. and [VALUE] <= 75.)
>          COLOR  70 255   0
>          OUTLINECOLOR 0 0 0
>       END
>
>However, if I query on dates too, then nothing is retrieved:
>
>CLASS
>          SYMBOL "cross"
>          EXPRESSION ([VALUE] > 50. and [VALUE] <= 75. and [BEGIN] <
>'2002-10-06T18:00:00')
>          COLOR  70 255   0
>          OUTLINECOLOR 0 0 0
>       END
>
>I've also tried the '2002-10-06 09:30' format, but no way...
>
>Thanks for any comment...
>Roberto
>
>
>



More information about the mapserver-users mailing list