Re: reformatting a name
- From: "Jason Lepack" <jlepack@xxxxxxxxx>
- Date: 30 Jan 2007 14:07:32 -0800
The field with your full name is nf
nf = "smith, john m"
first name = Left([nf],InStr(1,[nf],",")-1)
middle initial = Right([nf],1)
last name = Mid([nf],InStr(1,[nf]," ")+1,InStrRev([nf]," ")-InStr(1,
[nf]," ")-1)
SQL:
SELECT
Left([nf],InStr(1,[nf],",")-1) AS first_name,
Right([nf],1) AS middle_initial,
Mid([nf],InStr(1,[nf]," ")+1,InStrRev([nf]," ")-InStr(1,[nf]," ")-1)
AS last_name
FROM Table1;
Cheers,
Jason Lepack
On Jan 30, 4:44 pm, buckpeace <buckpe...@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
i have a field in a table that contains the name "smith, john m". (NOTE:
this name is all in one field...the 1st and last names are separated by a
comma, but the middle initial is not separated with a comma )
I need to put the name in 3 different fileds:
first name john
last name smith
middle initial m
Can anyone help me split up this name using an ACCESS Query????
I really appreciate it
--
Buck
.
- Prev by Date: Null to Zero in a crosstab
- Next by Date: Re: CrossTab quiry with Parameters
- Previous by thread: Null to Zero in a crosstab
- Next by thread: Re: reformatting a name
- Index(es):
Relevant Pages
|
|