Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SQL Case statement still returns NULL

$
0
0

I am having an issue with a SQL Select statement that comes from an existing application and getting it to always return a value for certain fields.

SQL
SELECTB.RIN,B.Year,B.Parcel,B.Principal,B.Penalty,0.00asSpecials,B.InterestDateTime,B.District,B.Interest,I.InterestRate,T.TaxesPaid,T.PenaltyPaid,T.InterestPaid,T.SpecialsPaid,dbo.coins_days360(B.InterestDateTime,GetDate())DaysElapsedFROMTRBackBLEFTJOINTRIRateIonI.Year=B.YearLEFTJOIN(SELECTYear,Parcel,SUM(casewhenTransType='R'thenPaymentelse0end)TaxesPaid,SUM(casewhenTransType='P'thenPaymentelse0end)PenaltyPaid,SUM(casewhenTransType='I'thenPaymentelse0end)InterestPaid,SUM(casewhenTransType='S'thenPaymentelse0end)SpecialsPaidFROMTRBackTransGROUPBYYear,Parcel)TonT.Year=B.YearandT.Parcel=B....

Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>