Update Query help needed

  • Thread starter Thread starter Amit
  • Start date Start date
A

Amit

MS Access 2K, Win XP
====================
Hi,

I have a table with a text field called "firstname". Some
of the data in this field has a space before the name. eg.
Instead of "Susan", it is " Susan".

I'm trying to design an update query that will replace all
occurrences of <space><firstname> with <firstname>, but am
at wits' ends as to what to put in the "criteria" field of
the update query.

Any help will be much appreciated.

Thanks!

-Amit
 
Nothing in the criteria
Update to Trim([field name])

If there are no spaces, there is nothing to trim.

-Lauri
 
I'm trying to design an update query that will replace all
occurrences of <space><firstname> with <firstname>, but am
at wits' ends as to what to put in the "criteria" field of
the update query.

LIKE " *"

that is, return all strings containing a literal blank followed by any
characters.

Another way to fix these is to update Firstname to

Trim([Firstname])

The trim function will remove any number of leading and trailing
blanks.
 
Thanks, Lauri and John. That was helpful!!

-Amit
-----Original Message-----
Nothing in the criteria
Update to Trim([field name])

If there are no spaces, there is nothing to trim.

-Lauri

MS Access 2K, Win XP
====================
Hi,

I have a table with a text field called "firstname". Some
of the data in this field has a space before the name. eg.
Instead of "Susan", it is " Susan".

I'm trying to design an update query that will replace all
occurrences of <space><firstname> with <firstname>, but am
at wits' ends as to what to put in the "criteria" field of
the update query.

Any help will be much appreciated.

Thanks!

-Amit


.
 
Back
Top