Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

WwWXxX, udp high ports, d-link extract firmware dsl-2750u, wwwwxxxxx.2G, yxxxcom, WWWXXX, ftp://192.168.100.100, wwwxxx 100, www.xxxcon, wwwxxx

Links

XODOX
Impressum

#1: DateAdd function ?

Posted on 2005-04-19 12:47:54 by zlatko.matic1

I am currently migrating from MSDE to PostgreSQL and have to rewrite the
function that is calculating next date of sampling...
In MSDE there is a DateAdd function. I can't find the appropriate function
in postgre. Can you help me?
The function in MSDE is the following:

ALTER FUNCTION dbo.slisp
(
@UCESTALOST_BROJ int,
@UCESTALOST_JEDINICA nvarchar (50),
@DATUM_ISPITIVANJA datetime
)
RETURNS datetime
AS
BEGIN
DECLARE @SLISP datetime
IF @UCESTALOST_JEDINICA='m' SET @SLISP=DATEADD(month, @UCESTALOST_BROJ,
MAX(@DATUM_ISPITIVANJA))
IF @UCESTALOST_JEDINICA='g' SET @SLISP=DATEADD(year, @UCESTALOST_BROJ,
MAX(@DATUM_ISPITIVANJA))
IF @UCESTALOST_JEDINICA='d' SET @SLISP=DATEADD(day, @UCESTALOST_BROJ,
MAX(@DATUM_ISPITIVANJA))
RETURN @SLISP
END

Thanks.

Report this message