main logo
Subject: Re: [ProLinux] PHP/Postgres date math confusion...
Author: Leland Jackson
Posted: 2006/05/31 15:35:56
 
View Entire Thread
New Search


I was just running some of the examples and learned that certain key
words need to be double quoted:

smvfp=# SELECT date('1980-06-25') + "interval"('21 years 8 days') AS
here_we_are;
here_we_are
---------------------
2001-07-03 00:00:00
(1 row)

smvfp=#

http://archives.postgresql.org/pgsql-php/2002-07/msg00031.php

Regards,

LelandJ

Leland Jackson wrote:

> Here is a link to an online book about PostgreSQL:
>
> http://www.commandprompt.com/ppbook/?lxpwrap=x8973%2ehtm
>
> I found this in the online book, which might be of help:
>
> http://www.commandprompt.com/ppbook/x2632#SETTINGDATEFORMATS
>
> The PostgreSQL to_char(time-string, format) function is equivalent to
> the MySQL DATE_FORMAT() function.
>
> Regards,
>
> LelandJ
>
>
> Matthew Jarvis wrote:
>
>> I am having a serious brain fart today...
>>
>> All I wanna do is compare a date I've retrieved from a table to the
>> current date, and if the interval is more than a year then set a flag
>> so I can display it in a report.
>>
>> No problem, but I'll be darned if I can get this to work... Me thinks
>> I'm confusing my PHP and Postgres...
>>
>> So if I'm running PHP code and I've got the table date stored to
>> $date, then how do I do the comparison?
>>
>> mj
>>
>
>
>
[excessive quoting removed by server]


 
©2006 Leland Jackson
<-- Prior Message New Search Next Message -->