Leading and Trailing Spaces RRS feed

  • Question

  • I am having a issue with Leading and Trailing Spaces. I have values that are being showed duplicates because they have leading, Trailing or any unoticiable ascii characters. I want to ensure that i remove them so the duplicates values can be handled.  I tried using in Query but i still had no success.

    thoguhts ?

    SELECT  Ltrim(Rtrim(FTA.BeforeValue)) BeforeValue, LEN(Ltrim(Rtrim(FTA.BeforeValue)))
    FROM            Fact_TicketAudit AS FTA INNER JOIN
                             Dim_Auditfield AS AF ON FTA.AuditFieldID = AF.AuditFieldID
     Where (AF.AuditFieldID = (10002)) 
     Group by Ltrim(Rtrim(FTA.BeforeValue)),  LEN(Ltrim(Rtrim(FTA.BeforeValue)))
    Order by Ltrim(Rtrim(FTA.BeforeValue))

    Wednesday, October 17, 2012 7:02 PM


All replies