Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update query, newbie

Status
Not open for further replies.

ad602000

IS-IT--Management
Jul 10, 2002
17
AU
I have a field called "given name", now in this field there are some people
who have two given names. Can anybody help me with an expression to use in
an update query that will delete the second given name? the names are
separated with a space

Many thanks
Peter
 
Update TableName Set [Given Name] = LTrim(Left([Given Name], Instr([Given Name], " "))) Where InStr([Given Name], " ")>0;

It should work.

Dan
[pipe]
 
This should do it. Just change the name of the table(Table1) to your tablename.

UPDATE Table1 SET Table1.[Given Name] = Mid$([Table1]![Given Name],1,InStr(1,[Table1]![Given Name]," ")-1);


Let me know how this works.
Bob Scriver
 
Bob, if there is no space in the string, Peter will have a hard time retyping the names...

Regards,

Dan
[pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top