query to extract the portion of text of fields in a Table

  • Thread starter Thread starter Fuzuy
  • Start date Start date
F

Fuzuy

All: I have a table have several fields that I would like to modify
from its original text content to only retain its first 25 characters.
How to do it in a query such that it could overwrite the fields of
that table? Thanks.
 
USE an update query and the Left function.

UPDATE YourTable
SET FieldA = LEFT([FieldA],25)
, FieldB = Left([FieldB],25)

This is a PERMANENT change.

In the query grid
-- Select the fields you want to modify
-- Select Query: Update from the menu
-- in UPDATE TO under each field you want to change type Left([Name of
field],25)
-- Select Query: Run from the menu.

WARNING: Back up your table data FIRST. Make a copy of the table or backup
the entire database. There is no undo.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top