Re: Problem in date function

From: "Jason Minion" <jason(dot)minion(at)sigler(dot)com>
To: "Ramesh Patel" <ramesh(at)banasdairy(dot)coop>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Problem in date function
Date: 2006-02-28 14:23:40
Message-ID: 261CF9EEB14F5442894AB6DDA93AA6F40758A2@mail.siglercompanies.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Ramesh Patel
Sent: Tuesday, February 28, 2006 1:37 AM
To: pgsql-admin(at)postgresql(dot)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(at)banasdairy(dot)coop
Mobile : 94263 91295

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

http://archives.postgresql.org

Browse pgsql-admin by date

  From Date Subject
Next Message Mario Splivalo 2006-02-28 15:53:00 pg_diff, or something like it...?
Previous Message Mohamed Fazil 2006-02-28 13:01:25 how to create new user