Remove first character

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to remove an apostrophe from the beginning of each entry in a field.
The entries vary, ie:
'6788993
'103-5597
'P103

Thx much for your help
 
neenmarie said:
I need to remove an apostrophe from the beginning of each entry in a field.
The entries vary, ie:
'6788993
'103-5597
'P103

UPDATE MyTable SET MyField = Right(MyField, Len(MyField) - 1);

Or

UPDATE MyTable SET MyField = Replace(MyField, "'", "");
 
Amy Blankenship said:
UPDATE MyTable SET MyField = Right(MyField, Len(MyField) - 1);

Or

UPDATE MyTable SET MyField = Replace(MyField, "'", "");

Or

UPDATE MyTable SET MyField = Mid(MyField, 2);
 
neenmarie said:
I need to remove an apostrophe from the beginning of each entry in a field.
The entries vary, ie:
'6788993
'103-5597
'P103


If you want to remove the ' from the beginning of a field in
each record.

UPDATE thetable
SET thefield = Mid(thefield, 2)
WHERE Left(thefield, 1) = "'"

If that's not what you want to do, please provide more
information.
 
Hope you checked Marshall's response - it is correct. You may get unexpected
results with Amy's response.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
Steve said:
Hope you checked Marshall's response - it is correct. You may get
unexpected results with Amy's response.

If all records have the ' and it is always the first record (which is what
she said) it should work.
 
first character not first record ---

Yes, I agree with you if you assume the two conditions are true for every
record:
1. all records have the '
2. ' is always the first character

However, you know what is said about "ass-u-me"!

Marshall's code does not assume!

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
Back
Top