Re: Problem in date function

Поиск
Список
Период
Сортировка
От Jason Minion
Тема Re: Problem in date function
Дата
Msg-id 261CF9EEB14F5442894AB6DDA93AA6F40758A2@mail.siglercompanies.com
обсуждение исходный текст
Ответ на Problem in date function  ("Ramesh Patel" <ramesh@banasdairy.coop>)
Список pgsql-admin
Assuming your New.dt is a date type and NEW.months is an integer, you
probably want to change your expression to something like:

NEW.dt + (NEW.months * INTERVAL '1 month')

Also a good read:

http://www.postgresql.org/docs/8.1/interactive/functions-datetime.html


Jason Minion

-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Ramesh Patel
Sent: Tuesday, February 28, 2006 1:37 AM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Problem in date function

dear All

I am use Trigger in my database  . In This  trigger i want to add months
in date.
date and  no of month come from insert query mean NEW.dt or NEW.months

new date = NEW.dt + NEW.months

I dont know how to add month in a date in trigger.

Please help me


Ramesh Patel
System Dept.
Banasdairy, Palanpur(B.K.)
E-Mail : ramesh@banasdairy.coop
Mobile : 94263 91295


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

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

Предыдущее
От: Mohamed Fazil
Дата:
Сообщение: how to create new user
Следующее
От: Mario Splivalo
Дата:
Сообщение: pg_diff, or something like it...?