469,645 Members | 1,551 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

DateAdd function?

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.
Jul 19 '05 #1
0 2583

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Abdul N K | last post: by
3 posts views Thread by Annette Massie | last post: by
4 posts views Thread by ey.markov | last post: by
1 post views Thread by C.Davidson | last post: by
reply views Thread by Zlatko Matić | last post: by
2 posts views Thread by Rich Raffenetti | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.