Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

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)

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

i need equivalent to prev query

thank u sir

pgsql-advocacy by date

Next:From: PramseyDate: 2004-07-19 18:08:21
Subject: Re:
Previous:From: eleinDate: 2004-07-17 20:56:42
Subject: OSCON: Booth Duties

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group