Replace certain Characters in a table

  • Thread starter Thread starter Olivier
  • Start date Start date
O

Olivier

Hello,

I guess this is a simple question for you guys:

I've got a table that contains first and last names in one field separate
with a comma (e.g. Jerry,McIntosh). I would like to have this table
displayed as Jerry McIntosh

What do I have to do?

Thanks for your help.

Regards,
Oliver
 
Lets say your field is called PersonName.
Create a query based on your table and put PersonName in as the only column.
From the query menu, change your query to an update query.
In the Update row of the PersonName column put this

Replace([PersonName],","," ")

Run the query. (I suggest you take a backup copy of the table beforehand -
just in case)
 
Hi Dennis,

Thanks for your help. I guess I was not precise enough. I would not like to
have the changes done permanently. The results should display the name
without the comma, but the data should remain as it is in the database.

Is this possible?

Regards,
Oliver


Dennis said:
Lets say your field is called PersonName.
Create a query based on your table and put PersonName in as the only
column.
From the query menu, change your query to an update query.
In the Update row of the PersonName column put this

Replace([PersonName],","," ")

Run the query. (I suggest you take a backup copy of the table beforehand -
just in case)

Olivier said:
Hello,

I guess this is a simple question for you guys:

I've got a table that contains first and last names in one field separate
with a comma (e.g. Jerry,McIntosh). I would like to have this table
displayed as Jerry McIntosh

What do I have to do?

Thanks for your help.

Regards,
Oliver
 
Olivier said:
Hi Dennis,

Thanks for your help. I guess I was not precise enough. I would not like to
have the changes done permanently. The results should display the name without
the comma, but the data should remain as it is in the database.

Is this possible?

Just use the same Replace expression in a SELECT query or in the ControlSource
of a TextBox on your form/report instead of in an UPDATE query.
 
Back
Top