|
-
Nov 9th, 2006, 11:57 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] trim character function?
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!
Last edited by drpcken; Nov 10th, 2006 at 12:01 AM.

In the unlikely event that I answer your question correctly, please Rate my post
Using Visual Studio 2005 Professional 
-
Nov 10th, 2006, 01:30 AM
#2
Re: trim character function?
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...
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Nov 10th, 2006, 01:34 AM
#3
Thread Starter
Fanatic Member
Re: trim character function?
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.
Code:
select substring(field, 1, len(field) -2)) from table
Thanks!

In the unlikely event that I answer your question correctly, please Rate my post
Using Visual Studio 2005 Professional 
-
Nov 10th, 2006, 01:37 AM
#4
Re: [RESOLVED] trim character function?
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Nov 10th, 2006, 10:21 AM
#5
Re: [RESOLVED] trim character function?
Just an FYI, there is also a Left (and Right) function:
Code:
select Left(field, len(field) -2)) from table
..it may be faster, but I'm not sure.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|