Re: how to cast for dates/datetimes?

Поиск
Список
Период
Сортировка
От Dave_Pfaltzgraff@patapsco.com
Тема Re: how to cast for dates/datetimes?
Дата
Msg-id 85256943.004245EC.00@patapsco.com
обсуждение исходный текст
Ответ на how to cast for dates/datetimes?  ("D. Duccini" <duccini@backpack.com>)
Список 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 по дате отправления:

Предыдущее
От: "D. Duccini"
Дата:
Сообщение: how to cast for dates/datetimes?
Следующее
От: "D. Duccini"
Дата:
Сообщение: Re: how to cast for dates/datetimes?