Re: adding years to a date field

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: adding years to a date field
Date: 2011-04-06 19:28:59
Message-ID: 4D9CBEFB.3010507@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/06/11 9:10 AM, Steve Crawford wrote:
> select ii_purchased + your_interval_field * '1 year'::date as date
> from inventory_item;

that SHOULD be written as...

select ii_purchased + your_interval_field * interval '1 year' as date
from inventory_item;

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2011-04-06 19:34:43 Postgres-9.x - ADODB - PHP
Previous Message Karsten Hilbert 2011-04-06 17:34:00 Re: adding years to a date field