Deleting the first 2 characters

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

Guest

I have an account # table that I use from a different source. The problem is
that there are two characters that are placed in front of the account numbers
that I need to remove. For example, the actual account # is 123400; however
it is listing it as 1=123400. How can I remove the first two characters, 1=,
and leave the rest alone?

Thanks in advance for your assistance.

Nyla
 
Permanently. Use an update query

NOTE: Backup your data first

UPDATE [TheTable]
SET [AccountNo] = Mid([AccountNo],3)
WHERE [AccountNo] Like "1=*"

If you are using the query grid
-- Select new query
-- Add your table
-- Add your field
-- Set the criteria to
Like "1=*"
-- Select Query: Update from the menu
-- ENTER Mid([AccountNo],2) into the update to. Be SURE you include the
square brackets around the field name.
-- Select Query:Run from the menu



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
Thank you so much, John! Your solution worked. Thanks again.

Nyla

John Spencer said:
Permanently. Use an update query

NOTE: Backup your data first

UPDATE [TheTable]
SET [AccountNo] = Mid([AccountNo],3)
WHERE [AccountNo] Like "1=*"

If you are using the query grid
-- Select new query
-- Add your table
-- Add your field
-- Set the criteria to
Like "1=*"
-- Select Query: Update from the menu
-- ENTER Mid([AccountNo],2) into the update to. Be SURE you include the
square brackets around the field name.
-- Select Query:Run from the menu



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================


Nyla said:
I have an account # table that I use from a different source. The problem is
that there are two characters that are placed in front of the account numbers
that I need to remove. For example, the actual account # is 123400; however
it is listing it as 1=123400. How can I remove the first two characters, 1=,
and leave the rest alone?

Thanks in advance for your assistance.

Nyla
 
Back
Top