<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;">Jay,<br><br>It looks like you may have borrowed some code from the SLP guys.&nbsp; They have their dates encoded using an integer format: YYMMDDHHMISS (or something dead similar).<br><br>That's why their code works.&nbsp; Right now Mapserver cannot do the date comparison, but GeoMOOSE can reformat dates into integers and Mapserver CAN do the integer comparison.<br><br>-Duck<br><br><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Jim Klassen &lt;Jim.Klassen@ci.stpaul.mn.us&gt;<br>To: jkapalczynski@ci.maple-grove.mn.us; geomoose-developers@lists.sourceforge.net; geomoose-users@lists.sourceforge.net<br>Sent: Tuesday, February 12, 2008 9:54:14 AM<br>Subject: Re:
 [Geomoose-users] EXPRESSIONS<br><br>

don't 
think 
you 
can 
do 
date/time 
comparisons 
using 
CGI 
Mapserver. 
I<br>think 
it 
is 
just 
treating 
the 
date 
as 

string.<br><br>One 
thing 
you 
could 
do 
is 
add 

field 
to 
the 
DBF 
file 
that 
stores 
the<br>date 
as 
an 
integer 
encoded 
as 
the 
number 
of 
days 
past 

certain 
time<br>(say 
Jan 

2000) 
and 
then 
you 
could 
use 
the 
integer 
comparison 
methods.<br>If 
you 
regenerate 
the 
file 
often, 
you 
could 
just 
have 
the 
extra 
column<br>be 
the 
number 
of 
days 
old 
the 
record 
is 
and 
not 
have 
to 
pass 
in 
the<br>extra 
parameter.<br><br>I 
think 
this 
is 
where 
most 
people 
suggest 
going 
to 

database 
driven<br>(PostGIS) 
data 
source 
so 
you 
can 
use 

select 
statement 
to 
calculate 
the<br>extra 
column 
on 
the 
fly.<br><br>&gt;&gt;&gt; 
"Jay 
Kapalczynski" 
&lt;<a ymailto="mailto:jkapalczynski@ci.maple-grove.mn.us" href="mailto:jkapalczynski@ci.maple-grove.mn.us">jkapalczynski@ci.maple-grove.mn.us</a>&gt; 
02/12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
&nbsp; 
 
SIZE 
12<br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
END<br><br> <br><br>So 
the 
problem 
is 
with 
the 
End 
of 
the 
Expression 
and 
how 
it 
is 
trying 
to<br>calculate 
dates 
for 
"LAST 
WEEK" 

"LAST 
TWO 
WEEKS" 
etc.....<br><br> <br><br>The 
.map 
file 
is 
correct 
minus 
the 
Time/Date 
and 
the 
.xml 
is<br>correct....the 
points 
show 
up...I 
need 
the 
date 
thing 
to 
work<br><br> <br><br>What 
code 
am 

missing 
to 
calculate 
the 
date 
range....or 
where 
that<br>would 
be 
coded?<br><br> <br><br>Any 
thoughts...<br><br> <br><br> <br><br>From: 
Jay 
Kapalczynski <br>Sent: 
Tuesday, 
February 
12, 
2008 
8:44 
AM<br>To: 
'<a ymailto="mailto:geomoose-users@lists.sourceforge.net" href="mailto:geomoose-users@lists.sourceforge.net">geomoose-users@lists.sourceforge.net</a>';<br><a ymailto="mailto:geomoose-developers@lists.sourceforge.net" href="mailto:geomoose-developers@lists.sourceforge.net">geomoose-developers@lists.sourceforge.net</a><br>Subject: 
EXPRESSIONS<br><br> <br><br> <br><br>I 
have 
been 
messing 
around 
with 
Expressions 
and 
cant 
seem 
to 
get 
it<br>right...I 
am 
missing 
something<br><br> <br><br>If 

eliminate 
the 
red 
line 
below 
the 
Symbols 
appear 
on 
the 
map...so 
I<br>can 
assume 
that 
the 
problem 
is 
with 
the 
Expression<br><br> <br><br>My 
shapefile 
has 
the 
two 
fields 
below<br><br> <br><br>Geo_Simple 

Text 
field 
with 
"BURGLARY" 
as 
the 
value 
for 
all 
records<br><br> <br><br>Geo_Time 

Date 
Field 
in 
this 
format..."2/8/2008"<br><br> <br><br>DOES 
ANYONE 
know 
why 
the 
expression 
is 
not 
working....Is 
there 
some 
code<br>that 

am 
missing???????<br><br> <br><br>Am 

missing 
the 
reference 
to 
the 
%LASTWEEK%????????????<br><br> <br><br>THANKS<br><br> <br><br> <br><br>IN 
THE 
"Burglaries_8bit.map" 
FILE<br><br> <br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
LAYER<br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
NAME 
'BURGLARIES'<br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
DATA 
'./Burglaries.shp'<br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
TYPE 
POINT<br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
STATUS 
DEFAULT<br><br> <br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
CLASS<br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp;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; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
HEADER 
'header.xml'<br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
TEMPLATE 
'record.xml'<br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
FOOTER 
'footer.xml'<br><br> <br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
END<br><br>END 
## 
end 
Map<br><br> <br><br> <br><br> <br><br>IN 
THE 
XML 
FILE<br><br> <br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
 
&lt;map 
title="BURGLARIES" 
default="true" 
reference="false"<br>popups="false" 
data="false"&gt;<br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&lt;param 
type="today" 
offset="-7" 
name="LASTWEEK"<br>format="%2Y%2M%2D000000"/&gt;<br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&lt;param 
type="today" 
offset="-14" 
name="LASTTWOWEEKS"<br>format="%2Y%2M%2D000000"/&gt;<br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&lt;param 
type="today" 
offset="-30" 
name="LASTTHIRTY"<br>format="%2Y%2M%2D000000"/&gt;<br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
&lt;param 
type="today" 
offset="-90" 
name="LASTNINTY"<br>format="%2Y%2M%2D000000"/&gt;<br><br> <br>&lt;file&gt;/ms4w/apps/GeoMOOSE/maps_statedemo/Burglaries/Burglaries_8bit.map&lt;<br>/file&gt;<br><br>&nbsp; 
&nbsp; 
&nbsp; 
&nbsp; 
 
&lt;/map&gt;<br><br> <br><br> <br><br> <br><br>WITH 
THE 
EXPRESSION:<br><br> <br><br> <br><br> <br><br>WITHOUT 
THE 
EXPRESSION:<br><br> <br><br> <br><br><br><br>-------------------------------------------------------------------------<br>This 
<a target="_blank" href="http://SF.net">SF.net</a> 
email 
is 
sponsored 
by: 
Microsoft<br>Defy 
all 
challenges. 
Microsoft(R) 
Visual 
Studio 
2008.<br><a href="http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/" target="_blank">http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/</a><br>_______________________________________________<br>Geomoose-users 
mailing 
list<br><a ymailto="mailto:Geomoose-users@lists.sourceforge.net" href="mailto:Geomoose-users@lists.sourceforge.net">Geomoose-users@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/geomoose-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/geomoose-users</a><br></div><br></div></div><br>

      <hr size=1>Never miss a thing.  <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your homepage.</a>

</body></html>