R: [postgis-users] Postgres/PostGIS and date field

P.Rizzi Ag.Mobilità Ambiente paolo.rizzi at ama-mi.it
Tue Dec 2 03:21:26 PST 2008


Maybe:
	select the_geom .......... 
		extract(day from (end_date -  now()) >= 10) as green 
		and extract(day from (end_date - now()) < 0) as red .... from ....

Bye
Paolo Rizzi


> -----Messaggio originale-----
> Da: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net]Per 
> conto di Mark
> Cave-Ayland
> Inviato: martedì 2 dicembre 2008 12.17
> A: PostGIS Users Discussion
> Oggetto: Re: [postgis-users] Postgres/PostGIS and date field
> 
> 
> Vincenzo Patruno wrote:
> 
> > Hi list!
> > 
> > In my file .map I wrote something like
> > 
> > 
> > select the_geom .......... (end_date -  now() >= 10) as 
> green and (end_date - now() < 0) as red .... from ....
> > 
> > 
> > 
> > The idea is using different coloured markers for expired 
> points  or valid points
> > 
> > After upgrading Postgres/Gis with last available versions, 
> the query above doesn't work anymore because  I cannot 
> compare date types with integers .......
> > Any idea?
> > 
> > Thanks in advance
> > 
> > Vinc
> 
> 
> Hi Vinc,
> 
> This sounds like the casting changes in 8.3 are hitting you 
> here. Have 
> you tried something like this:
> 
> select the_geom .......... (end_date -  now() >= '10 
> days'::interval) as 
> green and (end_date - now() < '0'::interval) as red .... from ....
> 
> I'm not sure exactly what units you were using, but you 
> should be able 
> to work with the example above to get what you want.
> 
> 
> HTH,
> 
> Mark.
> 
> -- 
> Mark Cave-Ayland
> Sirius Corporation - The Open Source Experts
> http://www.siriusit.co.uk
> T: +44 870 608 0063
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 



More information about the postgis-users mailing list