Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

convert PLSQL TO TSQL Expand / Collapse
Author
Message
Posted Tuesday, July 1, 2014 10:10 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, July 1, 2014 12:09 PM
Points: 5, Visits: 23
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)--
Post #1588111
Posted Tuesday, July 1, 2014 10:25 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 3:53 PM
Points: 20,704, Visits: 32,352
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.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1588123
Posted Tuesday, July 1, 2014 10:27 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 9:38 AM
Points: 2,858, Visits: 5,132
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!"
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Post #1588126
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse