subtracting from a date

Поиск
Список
Период
Сортировка
От Jay Vee
Тема subtracting from a date
Дата
Msg-id CADq_mb8CumMGtq23t0-Bj8JeN-X-Qe4t-qQYmWucqLzCLABsRg@mail.gmail.com
обсуждение исходный текст
Ответы Re: subtracting from a date  (Adrian Klaver <adrian.klaver@gmail.com>)
Re: subtracting from a date  (Steve Crawford <scrawford@pinpointresearch.com>)
Список pgsql-general
I have reviewed working with dates documentation but some things are not clear and I cannot get an example to work for what I need.

I am passing a date into a stored function like '2013-04-01'

The stored function accepts this string as a date type.

Within the function, I need to:
 
1.  subtract one year from this date into another date type
2.  subtract one month from this date into another date type
3.  subtract one day from this date into another date type

Are there any examples of this?  This is not a timestamp type, but a date type.

thanks

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

Предыдущее
От: Michael Sacket
Дата:
Сообщение: Re: Ordering Results by a Supplied Order
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: subtracting from a date