Search Postgresql Archives

Re: partial time stamp query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 4, 2013 at 9:45 AM, Kirk Wythers <kirk.wythers@xxxxxxxxx> wrote:
I am trying to write a query that grabs one particular day from a timestamp column. The data are ordered in 15 minute chunks like this:

2010-07-07 12:45:00
2010-07-07 13:00:00
2010-07-07 13:15:00
2010-07-07 13:30:00
etc…

WHERE derived_tsoil_fifteen_min_stacked.time2 = '2010-07-07*'
but that grabs nothing

Just cast the timestamp to a date before you compare it:

WHERE derived_tsoil_fifteen_min_stacked.time2::date = '2010-07-07'

--
Moshe Jacobson
Nead Werx, Inc. | Manager of Systems Engineering
2323 Cumberland Parkway, Suite 201 | Atlanta, GA 30339
moshe@xxxxxxxxxxxx | 
www.neadwerx.com

"People don't multitask because they're good at it. They do it because they are more distracted" -- David Sanbonmatsu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux