Is there a function that will trim a designated amount of characters off the right (or left) end of a string? I'm using sql server 2005.
Thanks!
Printable View
Is there a function that will trim a designated amount of characters off the right (or left) end of a string? I'm using sql server 2005.
Thanks!
If Im not wrong SubStr or SubString is the function to extract specific chars from a given string...its equivalent to Mid function is vb...
excellent! I used the substring category to start from the beginning, then got the length of the string and subtracted the number of characters i wanted to cut off.
Thanks!Code:select substring(field, 1, len(field) -2)) from table
you are most welcome...
Just an FYI, there is also a Left (and Right) function:
..it may be faster, but I'm not sure.Code:select Left(field, len(field) -2)) from table