Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

bind-address mysql multiple, sanibleone xxxx, ftp://192.168.100.100/, www.xxxcon, which comes first ob_start or session, wwwxxx/58/2010, xxxxdup, xxxxdup, mailx informatii, should producers of software-based services, such as atms, be held liable for economic injuries suffered when their systems fail?

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