convert PLSQL TO TSQL

  • HOW TO CONVERT THE BELOW FROM PLSQL TO TSQL

    YTD_Deprn2=DECODE(SUBSTR(Period_Name,-2),SUBSTR(:Date,-2),DECODE(NVL(Prior Fy Expense,0),0,NVL(Ytd_ Deprn,0),Ytd Less Pfye),0)

    YTD Deprn=DECODE(TRUNC(PYE Deprn Reserve+YTD Deprn2,2),0,0,YTD Deprn2)--

  • First, are you using SQL Server 2012 or SQL Server 2005? You have double posted in two different forums.

    Second, please don't double post, it fragments answers you may get.

    Third, you want to convert the DECODE to a CASE clause.

  • Double Post!

    Replies in:

    http://www.sqlservercentral.com/Forums/Topic1588112-3077-1.aspx

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply