from oracle (pl/sql) to sql server (t-sql)

from oracle (pl/sql) to sql server (t-sql)

Post by alex ivasc » Wed, 16 Jul 2003 09:25:12


Hi. How can I modify this statement to work in sql server?

MOD((TRUNC(a.sql_date) - TRUNC
(d.dts_start_day_ref)),d.days_in_schedule)+1

Thanks!!!

Alex Ivascu
 
 
 

from oracle (pl/sql) to sql server (t-sql)

Post by Dean Savov » Wed, 16 Jul 2003 16:20:58

What does this line of code do?
Try posting as pseudocode or describe it.

 
 
 

from oracle (pl/sql) to sql server (t-sql)

Post by Dean Savov » Wed, 16 Jul 2003 23:56:39

There is no function that returns modulo of division.

You can always use stadard mathematical procedure:

declare @a int
,@b int

select @a = 15
, @b = 6

select 15 - (@a / @b) * @b

--
Dean Savovic
www.teched.hr
 
 
 

from oracle (pl/sql) to sql server (t-sql)

Post by alex ivasc » Thu, 17 Jul 2003 00:17:39

thanks, Dean.

However, I found a modulo in sql server, but now am having
trouble making it work with datetime datatypes.

(a.sql_date - d.dts_start_day_ref)%
days_in_schedule+1=day_of_schedule

sql_date is datetime
dts_start_day_ref is datetime
days_in_scheduler is int
day_of_schedule is int

thanks for any help!!!

alex ivascu



message