interval - doubt - Mailing list pgsql-advocacy

From gopal
Subject interval - doubt
Date
Msg-id 40FB75A5.3030702@ceedees.com
Whole thread Raw
List 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





pgsql-advocacy by date:

Previous
From: Bruce Momjian
Date:
Subject: Arrival at OSCON
Next
From: Jan Wieck
Date:
Subject: Re: OSCON and cellphone