Re: how to cast for dates/datetimes? - Mailing list pgsql-novice

From Dave_Pfaltzgraff@patapsco.com
Subject Re: how to cast for dates/datetimes?
Date
Msg-id 85256943.004245EC.00@patapsco.com
Whole thread Raw
In response to how to cast for dates/datetimes?  ("D. Duccini" <duccini@backpack.com>)
List pgsql-novice



Dave Pfaltzgraff@PATAPSCO
08/22/2000 08:03 AM

D. Ducnini asks:
>how do i get around this?
>
>select sum(total) from lineitemsnext where date <= ('now'::date + '1
>month'::timespan);
>
>ERROR:  Unable to identify an operator '<=' for types 'date' and
>'datetime'
>        You will have to retype this query using an explicit cast

I have not used this kind of select to find a SUM, but when I delete old data
from a log, I use:
DELETE FROM Log WHERE LG_Time < 'today'::timestamp - '1 month'::timespan;

Is your problem occuring because you're mixing a 'date' and a 'timestamp'?




pgsql-novice by date:

Previous
From: "D. Duccini"
Date:
Subject: how to cast for dates/datetimes?
Next
From: "D. Duccini"
Date:
Subject: Re: how to cast for dates/datetimes?