Date Interval

From: "Magdalena Komorowska" <meluzyna(at)w3(dot)net(dot)pl>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Date Interval
Date: 2005-12-06 13:49:33
Message-ID: 20051206135906.ECA9713E35@spinet.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,
I hale a problem with counting interwal and I can't find what to do with
this.
I have two fields in the table:
Column | Type | Modifiers
-----------------+---------+-----------
date_in | date |
interwal_months | numeric |
-----------------+---------+-----------

Query
SELECT date_in + INTERVAL '3 MONTH' FROM any_table
works fine of course.

However, how to do something like that?
SELECT date_in + INTERVAL ' interwal_months MONTH' FROM any_table

I hope I'm just blind.. ;-)
Thanks for any help.
MK

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Mario Splivalo 2005-12-06 14:08:03 JOIN query not working as expected
Previous Message Alban Hertroys 2005-12-06 10:45:48 Re: need help