Removing a character in a field

R

Ramesh

Hi,

I have a table which contains an asterisk marks in some of the fields in
some records. What would be the easiest way to get rid of them? Wherever
there are asterisk, I need them to be Null fields. I tried with Find and
replace with "" mark, but it doesnt seem to work. Am I missign something?

Thanks
Ramesh
 
J

John W. Vinson

Hi,

I have a table which contains an asterisk marks in some of the fields in
some records. What would be the easiest way to get rid of them? Wherever
there are asterisk, I need them to be Null fields. I tried with Find and
replace with "" mark, but it doesnt seem to work. Am I missign something?

Thanks
Ramesh

Update the field to NULL:

UPDATE mytable
SET myfield = Null
WHERE myfield = "*";

John W. Vinson [MVP]
 
K

Kelsy

Hi,

I have a table which contains an asterisk marks in some of the fields in
some records. What would be the easiest way to get rid of them? Wherever
there are asterisk, I need them to be Null fields. I tried with Find and
replace with "" mark, but it doesnt seem to work. Am I missign something?

Thanks
Ramesh

Hi - if i understand correctly, you want any strings containing an
asterisk replaced with null. It's a little tricky since the asterisk
has special meaning. I think you need to do an update query. Try:

UPDATE MYTABLE SET MYTABLE.MYFIELD = Null
WHERE (((MYTABLE.MYFIELD) Like "*[*]*"));
 
F

fredg

Hi,

I have a table which contains an asterisk marks in some of the fields in
some records. What would be the easiest way to get rid of them? Wherever
there are asterisk, I need them to be Null fields. I tried with Find and
replace with "" mark, but it doesnt seem to work. Am I missign something?

Thanks
Ramesh

You write "an asterisk marks" plural, yet later you write "*" mark
(singular).

If only one asterisk in the field:

Create an Update query.
Update YourTable Set YourTable.FieldName = Null
Where YourTable.FieldName = "*";

If more than one * in the field, use:

Update YourTable Set YourTable.FieldName = Null
WHERE InStr([FieldName],"*") > "0";

Any record which contains one or more asterisks will be changed.
 
R

Ramesh

Thansk very much John, Kelsy and Fredgy.

The job got so easily done. Funny how i was struggling for so long.

Ramesh
 

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

Top