Query with dates in

Roberto Bianconi roberto.bianconi at GMAIL.COM
Mon Feb 28 16:07:56 EST 2005


Thanks,
it works as you suggested, both with:

       CLASS
       # 1
          SYMBOL "cross"
          EXPRESSION ([VALUE] > 50. and [VALUE] <= 75. and `[BEGIN]` <
`2002-10-05T06:00:00`)
          COLOR  70 255   0
          OUTLINECOLOR 0 0 0
       END

and:

       CLASS
       # 1
          SYMBOL "cross"
          EXPRESSION ([VALUE] > 50. and [VALUE] <= 75. and `[BEGIN]`
lt `2002-10-05T06:00:00`)
          COLOR  70 255   0
          OUTLINECOLOR 0 0 0
       END

By the way, if the date is not in ISO format
(http://wwp.greenwichmeantime.com/info/iso.htm), it does not work:

       CLASS
       # 1
          SYMBOL "cross"
          EXPRESSION ([VALUE] > 50. and [VALUE] <= 75. and `[BEGIN]`
lt `05-10-2002 06:00`)
          COLOR  70 255   0
          OUTLINECOLOR 0 0 0
       END

Thanks a lot,
Roberto





On Mon, 28 Feb 2005 12:52:30 -0800, Yewondwossen Assefa
<assefa at dmsolutions.ca> wrote:
> 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