extraing data from field

A

Alex H

Hi, I have 1300 records where in one field is the text "moderator......."

I needto extract everything after and including the word "Moderator" and
place it into another field.

Is thispossibleplease and whats the best way to go about it

Thanks

A
 
B

Brendan Reynolds

An update query ...

UPDATE tblTest SET tblTest.NewField =
Mid$([OldField],InStr(1,[OldField],"Moderator"))
WHERE (((InStr(1,[OldField],"Moderator"))>0));

Where "tblTest" is the name of your table, "NewField" is the name of the
field into which the text is to be placed, and "OldField" is the name of the
field from which the text is to be extracted.

See 'Mid Function' and 'InStr Function' in the help files for more
information.
 
A

AlCamp

Do an "Update" Query, and use this criteria for updating the your new field
Left([YourFieldName],9) = "moderator"
hth
Al Camp
 
S

SJ

Brendan

many thanks

Can I also remove the updated text from the old field?

Thanks

Alex

Brendan Reynolds said:
An update query ...

UPDATE tblTest SET tblTest.NewField =
Mid$([OldField],InStr(1,[OldField],"Moderator"))
WHERE (((InStr(1,[OldField],"Moderator"))>0));

Where "tblTest" is the name of your table, "NewField" is the name of the
field into which the text is to be placed, and "OldField" is the name of
the field from which the text is to be extracted.

See 'Mid Function' and 'InStr Function' in the help files for more
information.

--
Brendan Reynolds (MVP)

Alex H said:
Hi, I have 1300 records where in one field is the text
"moderator......."

I needto extract everything after and including the word "Moderator" and
place it into another field.

Is thispossibleplease and whats the best way to go about it

Thanks

A
 
B

Brendan Reynolds

That would be ...

Left$([OldField],InStr(1,[OldField],"Moderator") - 1)

--
Brendan Reynolds (MVP)

SJ said:
Brendan

many thanks

Can I also remove the updated text from the old field?

Thanks

Alex

Brendan Reynolds said:
An update query ...

UPDATE tblTest SET tblTest.NewField =
Mid$([OldField],InStr(1,[OldField],"Moderator"))
WHERE (((InStr(1,[OldField],"Moderator"))>0));

Where "tblTest" is the name of your table, "NewField" is the name of the
field into which the text is to be placed, and "OldField" is the name of
the field from which the text is to be extracted.

See 'Mid Function' and 'InStr Function' in the help files for more
information.

--
Brendan Reynolds (MVP)

Alex H said:
Hi, I have 1300 records where in one field is the text
"moderator......."

I needto extract everything after and including the word "Moderator" and
place it into another field.

Is thispossibleplease and whats the best way to go about it

Thanks

A
 

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