By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,400 Members | 981 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,400 IT Pros & Developers. It's quick & easy.

Trim characters from a field

P: 69
Hello all,

I was wondering if anyone can help me with a little problem.

I have a field in a table where I want to remove the last character in that field for every record (using a query).

Example:

Table: test

Field: Code (text field)

Some data:

Code
B1R200
B1R201
B1R202
B1R203

Duplicates are allowed. When I'm done I would want the last character taken off of each of those records so they would all look like:

B1R20

I appreciate any help.

Thanks,
narpet
Dec 11 '06 #1
Share this Question
Share on Google+
2 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
The following update query will remove the last character from the values in the field Code.

[code]
UPDATE test SET [code]=Left([code], Len(
Expand|Select|Wrap|Line Numbers
  1. )-1)
  2.  
Mary
Dec 11 '06 #2

P: 69
Thanks for the quick response!

I can always count on the people here to help, this is a great place!

narpet
Dec 11 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.