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

From D. Duccini
Subject Re: how to cast for dates/datetimes?
Date
Msg-id Pine.GSO.4.03.10008220904310.12957-100000@ra.bpsi.net
Whole thread Raw
In response to how to cast for dates/datetimes?  ("D. Duccini" <duccini@backpack.com>)
List pgsql-novice
> I suspect that your calculation yeilds a timestamp instead of date because
> 'now' is a timestamp, not a date, try:
>
> select sum(total) from lineitemsnext where date <= ('now'::date + '1
> month'::timespan)::date;

This one did the trick.  I'll try the other variants later on.

Thanks!

-duck


-----------------------------------------------------------------------------
david@backpack.com            BackPack Software, Inc.        www.backpack.com
+1 651.645.7550 voice       "Life is an Adventure.
+1 651.645.9798 fax            Don't forget your BackPack!"
-----------------------------------------------------------------------------


pgsql-novice by date:

Previous
From: Dave_Pfaltzgraff@patapsco.com
Date:
Subject: Re: how to cast for dates/datetimes?
Next
From: "Ryan Williams"
Date:
Subject: Unsigned?