Archive for category TSQL

LTRIM RTRIM don’t always work –UDF (UPDATED)

I previously posted on the LTRIM and RTRIM inability to remove certain not printing whitespace characters which can sometimes cause problems. I have updated the SQL page with a User Defined Function (UDF) which can be used in queries or in a stored procedure. I have also included a link to the Code Project article.

Ltrim Rtrim don’t always work

Leave a comment

LTRIM RTRIM don’t work

LTRIM and RTRIM does not work sometimes if the whitespace character is not actually character ASCII 32. This stumped me for a while. The data entry screen used to enter the information somehow allows users to enter other white space characters other than the regular space from the space bar. It could be related to the system encoding, I don’t know. Here is the code I used to fix the LTRIM and RTRM.

Ltrim Rtrim don’t always work

Leave a comment