Re: casting for dates

Поиск
Список
Период
Сортировка
От Andrew McMillan
Тема Re: casting for dates
Дата
Msg-id 1001537839.2178.2.camel@kant.mcmillan.net.nz
обсуждение исходный текст
Ответ на casting for dates  (Vince Vielhaber <vev@michvhf.com>)
Ответы Re: casting for dates
Список pgsql-hackers
On Thu, 2001-09-27 at 08:30, Vince Vielhaber wrote:
> 
> I'm trying to use an integer from a table to add/subtract time in months.
> IOW:
> 
> create table foo(nummonths int);
> 
> select now() - nummonths months;

newsroom=# select now() - interval( text(3) || ' months');       ?column?        
------------------------2001-06-27 08:56:27+12
(1 row)


Crude, but hey: it works :-)

Cheers,                SAndrew.
-- 
--------------------------------------------------------------------
Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/        PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7217    MOB: +64(21)635-694    OFFICE: +64(4)499-2267



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Vince Vielhaber
Дата:
Сообщение: casting for dates
Следующее
От: Neil Padgett
Дата:
Сообщение: Re: Spinlock performance improvement proposal