interval - doubt

From: gopal <gopal(at)ceedees(dot)com>
To: pgsql-advocacy(at)postgresql(dot)org
Subject: interval - doubt
Date: 2004-07-19 07:17:57
Message-ID: 40FB75A5.3030702@ceedees.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy

In a Table Contains Field
a) fromdate
b) no_of_years

I want get the result from ==> fromdate's year + no_of_years

EX:
12-05-2004 as fromdate and no_of_years is 2 (like that)
i have the no_of_years in variable manner)

i have tried of

select fromdate, fromdate + interval '2 year' as todate from table;
(this is working)
but

select fromdate, fromdate + interval no_of_years as todate from table;
(not is working)

i need equivalent to prev query

thank u sir
gopal

Browse pgsql-advocacy by date

  From Date Subject
Next Message Pramsey 2004-07-19 18:08:21 Re:
Previous Message elein 2004-07-17 20:56:42 OSCON: Booth Duties