Access 2000 - Eliminate characters in a field

  • Thread starter Thread starter Abay
  • Start date Start date
A

Abay

Hello ... I would like to eliminate the first three characters in a field.
Any help would be much appreciated.

Abay
 
UPDATE TestTable SET TestTable.TestField = Mid$([TestField],4)
WHERE (((TestTable.TestField) Is Not Null));

Where 'TestTable' is the name of your table and 'TestField' is the name of
the field you want to update.

Note that the result will be an empty string if 'TestField' originally
contained three characters or less. You might need to modify the query if
that's not the result you want.

As always before performing any bulk update, it would be wise to test this
on a copy of your data first.
 
Hello ... I would like to eliminate the first three characters in a field.
Any help would be much appreciated.

Abay

Easy,,,

Say the name of your field is "name"

Then you can run a query and in the criteria field enter:

Right([name],(Len([name])-3))
 
Many thanks for both replies ... tried both ... on a test set :) and they
work like a charm ...

Most appreciated

Abay

Brendan Reynolds said:
UPDATE TestTable SET TestTable.TestField = Mid$([TestField],4)
WHERE (((TestTable.TestField) Is Not Null));

Where 'TestTable' is the name of your table and 'TestField' is the name of
the field you want to update.

Note that the result will be an empty string if 'TestField' originally
contained three characters or less. You might need to modify the query if
that's not the result you want.

As always before performing any bulk update, it would be wise to test this
on a copy of your data first.

--
Brendan Reynolds
Access MVP

Abay said:
Hello ... I would like to eliminate the first three characters in a
field. Any help would be much appreciated.

Abay
 
Back
Top