Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert Oracle SQL line to SQL Server SQL

Johnbr (Oracle10G)Mar 1 2013 — edited Mar 1 2013
Hi All,

I'm trying to convert this Oracle SQL to SQL that will work with SQL Server 2008 and am having some trouble with the MOD function. Anyone have any SQL Server chops?

Oracle SQL
TBL_MAIN.AuthoredDate- MOD (TBL_MAIN.AuthoredDate - to_date ('2012-01-01', 'fxYYYY-MM-DD'), 7) + 6 AS "Week Ending"
SQL Server Code
TBL_MAIN.AuthoredDate - ((Cast(TBL_MAIN.AuthoredDate as DATE) % CAST('2012-01-01' AS DATE)), 7) + 6 AS "Week Ending"
Thanks,

John

Edited by: Johnbr (Oracle10G) on Mar 1, 2013 8:41 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 29 2013
Added on Mar 1 2013
1 comment
207 views