SEPARATE NAMES

  • Thread starter Thread starter T JONES
  • Start date Start date
T

T JONES

I know it is here somewhere but I haven't been able to
find it. I need to separate the "Mail_Name" (which has
text like "John Smith" into separate "First Name" (John)
and "Last Name" (Smith) fields. Nothing fancy, no "wierd
names", just separate. I've tried writing an update
query, but am soooo rusty I just can't get it to work. I
know I've seen it but the searches haven't resulted in any
help.

Thanks for any info.

TJones
 
Didn't mean to "shout", but didn't have my glasses handy
and didn't realize CAPS lock was on! Sorry.
 
Try these ...

FirstName: Left([Mail_Name], InStr([Mail_Name], " ") -1)

LastName: Mid([Mail_Name], InStr([Mail_Name], " "), +1)


hth,
 
And, here is SQL code for an Update Query:

UPDATE [MyTable] SET [MyTable].FirstName =
Left([Mail_Name],InStr([Mail_Name]," ")-1), [MyTable].LastName =
Mid([Mail_Name],InStr([Mail_Name]," ")+1)
 
Thanks Cheryl,

I just have 1 problem..... is this for an update query
and, if so, where/how do I input this? If it is not for a
query, then where do I use this. I am sooooo extremely
rusty it is taking me forever to get this figured out.

Thanks
T Jones

-----Original Message-----
Try these ...

FirstName: Left([Mail_Name], InStr([Mail_Name], " ") -1)

LastName: Mid([Mail_Name], InStr([Mail_Name], " "), +1)


hth,
--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


T JONES said:
I know it is here somewhere but I haven't been able to
find it. I need to separate the "Mail_Name" (which has
text like "John Smith" into separate "First Name" (John)
and "Last Name" (Smith) fields. Nothing fancy, no "wierd
names", just separate. I've tried writing an update
query, but am soooo rusty I just can't get it to work. I
know I've seen it but the searches haven't resulted in any
help.

Thanks for any info.

TJones


.
 
Back
Top