First NEVER use NAME as a field name it's a reserved word!
To filter out the NAMEs with 4 characters use Like "[a-zA-Z][a-zA-Z][a-zA-Z][a-zA-z]*" in the criteria of a query. That will give you all the records with 4+ characters in NAME.
To obtain SECNAME use IIf(InStr([NAME]," ")>0,Left([NAME],InStr([NAME]," ")-1),[NAME]) in the same query in a Field. If you run the query you will have a list of all your SECNAMEs. You can then use this query to update your new SECNAME field.
Copy and paste this into a new query in SQL View (change Table4 to your table name).
SELECT IIf(InStr([NAME]," ")>0,Left([NAME],InStr([NAME]," ")-1),[NAME]) AS newSECNAME
FROM Table4
WHERE (((Table4.NAME) Like "[a-zA-Z][a-zA-Z][a-zA-Z][a-zA-z]*"));
HTH.
Malc.
|