[Solved] Code formatting fails

5 Posts
2 Users
0 Likes
246 Views
(@jpotelle)
Member
Joined: 2 years ago
Posts: 15
Topic starter  

This bit of code fails to format correctly in SQLinForm, mostly at the bottom.

Select
Cast( Sum( Cast (
Case
When CLMS.APA_CD in ( 1 , 2 )
Then Coalesce( Cast( CLMS.DC_AMT_AGG as DECIMAL(30,8)) ,0) -
Coalesce( Cast( CLMS.APA_RDCTN_AMT_AGG as DECIMAL(30,8)) ,0)
Else Coalesce( Cast( CLMS.DC_AMT_AGG as DECIMAL(30,8)) ,0)
End as DECIMAL(30,8)) ) as DECIMAL(30,8)) as DC_AMT_AGG_APA
From TABLE1 as CLMS
Left Join TABLE2 as DC_E
On CLMS.PERF_YEAR = DC_E.PERF_YEAR and CLMS.DCE_ID = DC_E.DCE_ID
Where CLMS.FIN_ELIG = 1
Group By CLMS.PERF_YEAR, CLMS.CLNDR_YR


   
Quote
Guido
(@admin)
Member Admin
Joined: 2 years ago
Posts: 175
 

Hi jpotelle,

which DB did you choose in the General option?

Formatting your SQL gives this result.

grafik

Could you please point me to the formatting problem

 

Thx

Guido


   
ReplyQuote
(@jpotelle)
Member
Joined: 2 years ago
Posts: 15
Topic starter  

@admin TERADATA, below is formatting results

See the end of the CASE, the formatting trouble happens at FROM

Select
  Cast(
  Sum(
  Cast (
    Case
      When CLMS.APA_CD in ( 1
                        , 2 )
        Then Coalesce( Cast( CLMS.DC_AMT_AGG as     DECIMAL(30,8)) ,0) -
          Coalesce( Cast( CLMS.APA_RDCTN_AMT_AGG as DECIMAL(30,8)) ,0)
      Else Coalesce( Cast( CLMS.DC_AMT_AGG as       DECIMAL(30,8)) ,0)
    End as                                          DECIMAL(30,8)) ) as DECIMAL(30,8)) as DC_AMT_AGG_APA From TABLE1 as
          CLMS Left Join TABLE2 as DC_E On CLMS.PERF_YEAR = DC_E.PERF_YEAR
          and CLMS.DCE_ID                                 = DC_E.DCE_ID Where CLMS.FIN_ELIG = 1 Group By
          CLMS.PERF_YEAR, CLMS.CLNDR_YR

   
ReplyQuote
Guido
(@admin)
Member Admin
Joined: 2 years ago
Posts: 175
 

thx!

This is what I get using N++ 8.4.6 with SQLinForm 6.22.10.07

I imported your profile

grafik

Do you have some speciel white space chars before the "FROM" character?

Anyway I will think about this issue.

Regards


   
ReplyQuote
(@jpotelle)
Member
Joined: 2 years ago
Posts: 15
Topic starter  

Ah, I forgot how frequently your plugin is updated.  I updated NP++ to v8.4.6 (from v8.4.5), no joy. Then I updated SQLinForm to 6.22.10.04 (from 6.22.09) and this fixed the problem. Thanks!


   
ReplyQuote
Share: