Re: Dateadd
Re: Dateadd
От:
Vivek Khera <khera@kcilink.com>
Дата:
>>>>> "LP" == Ligia Pimentel 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: khera@kciLink.com Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/