Search Postgresql Archives

Re: adding years to a date field

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

 



On Apr 6, 2011, at 12:18, Christine Penner wrote:

> This still gave me a sytax error. The other suggestion to multiply the interval field by 1 year also gave me a syntax error.

What was the error? And it's preferable to do multiply rather than do the equivalent of an eval on some string.


select (current_timestamp at time zone 'utc' + CAST(3 AS SMALLINT) * interval '1 year');
          ?column?          
----------------------------
 2014-04-06 16:27:30.273562
(1 row)

Michael Glaesemann
grzm seespotcode net




-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[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