From: | "Adam Rich" <adam(dot)r(at)sbcglobal(dot)net> |
---|---|
To: | "'Nico Grubert'" <nicogrubert(at)gmail(dot)com>, "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist |
Date: | 2009-03-06 07:03:22 |
Message-ID: | 011301c99e29$a3c675b0$eb536110$@r@sbcglobal.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
>
>
> > This query makes little sense. Why are you trying to convert a
> > timestamp to a timestamp? Is this a bizarre substitute for
> date_trunc()?
>
> The "from_datetime" column is of type "timestamp" but I want to check
> only the date, not the time.
> In this example I want to retrieve all records whose "from_datetime" is
> e.g. >= 2009/05/06 (Now()) so I'd like to get results with a
> "from_datetime" like e.g.
> - 2009/05/06 00:05:00
> - 2009/05/06 23:30:00
> - 2009/05/07 10:15:00
>
> Regards
> Nico
>
I use something like this:
Where from_datetime::date >= current_date
Or
Where date_trunc('day', from_datetime) >= current_date
(current_date is like "now()" except it's a date instead of timestamp)
From | Date | Subject | |
---|---|---|---|
Next Message | Adam Rich | 2009-03-06 07:04:51 | Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist |
Previous Message | Scott Marlowe | 2009-03-06 07:02:04 | Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist |