You are here: Re: postgres timestame php « PHP SQL « IT news, forums, messages
Re: postgres timestame php

Posted by Tom on 01/13/07 00:56

On Fri, 12 Jan 2007 09:59:24 +0100, Rik wrote...
>
>ZMAN wrote:
>> Hello All-
>>
>> I need to extract a result from a postgres database and PHP.
>> I need to get everything greater than today's date.
>> I'm comparing it against a timestamp field that can have something
>> like '2006-12-30 05:47:35.089-05' or NULL.
>> Basically:
>> SELECT * from table_name
>> WHERE timestamp_field is >= today
>>
>> I want the NULL values in the result set as well...
>>
>
>Euhm, not sure about postgres, in MySQL this works:
>WHERE timestamp_field >= NOW() OR timestamp_field IS NULL


I think Postgres does dates like..

WHERE timestamp_field >= 'today'::date

or

WHERE timestamp_field > 'today'::date - '1 day'::interval

Tom
--
Newsguy.com - Express Accounts - 30 GB $9.95 / month

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация