| From: | Dave_Pfaltzgraff(at)patapsco(dot)com |
|---|---|
| To: | pgsql-novice(at)postgreSQL(dot)org |
| Cc: | duccini(at)backpack(dot)com |
| Subject: | Re: how to cast for dates/datetimes? |
| Date: | 2000-08-22 12:03:52 |
| Message-ID: | 85256943.004245EC.00@patapsco.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
Dave Pfaltzgraff(at)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'?
| From | Date | Subject | |
|---|---|---|---|
| Next Message | D. Duccini | 2000-08-22 14:05:50 | Re: how to cast for dates/datetimes? |
| Previous Message | D. Duccini | 2000-08-21 23:22:36 | how to cast for dates/datetimes? |