SQL White Spaces

I found myself with an issue with SQL Data. I could not trim the data with the trailing white space. Only this worked!

  UPDATE tblPipeClasses
  SET PipeClass =  Replace(PipeClass, Char(160),'')

I also wrote this function in VBA

Public Function RemoveExtendedAsciiCharacters(strString As String) As String

    Dim intCount As Integer    

    For intCount = 128 To 255

        If InStr(1, strString, Chr(intCount)) > 0 Then

            strString = Replace(strString, Chr(intCount), "")

        End If

    Next intCount    

    RemoveExtendedAsciiCharacters = strString

End Function

 

Add comment

Loading