Re: Problem in date function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx
[mailto:pgsql-admin-owner@xxxxxxxxxxxxxx] On Behalf Of Ramesh Patel
Sent: Tuesday, February 28, 2006 1:37 AM
To: pgsql-admin@xxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxx
Mobile : 94263 91295


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

               http://archives.postgresql.org


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux