How to use a TRIM function in SQL Server

前端 未结 4 1913
情话喂你
情话喂你 2020-12-30 19:32

I cannot get this TRIM code to work

SELECT 
   dbo.COL_V_Cost_GEMS_Detail.TNG_SYS_NR AS [EHP Code], 
   dbo.COL_TBL_VCOURSE.TNG_NA AS [Course Title], 
   LTR         


        
4条回答
  •  有刺的猬
    2020-12-30 20:10

    LTRIM(RTRIM(FCT_TYP_CD)) & ') AND (' & LTRIM(RTRIM(DEP_TYP_ID)) & ')'
    

    I think you're missing a ) on both of the trims. Some SQL versions support just TRIM which does both L and R trims...

提交回复
热议问题