>>>>> "LP" == Ligia Pimentel <[EMAIL PROTECTED]> writes:
LP> I need to know if there is a sql function implemented in postgres
LP> that gives me a date plus any number of days, months or years (the
LP> traditional dateadd function) or how to do it in sql?
Here's what I use:
select CURRENT_DATE + '4 DAYS'::interval;
Just cast your "interval" from a string to an interval type, then add
it to your date value.
I doubt this is portable. What "tradition" provides for a dateadd()
function?
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: [EMAIL PROTECTED] Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html