Extracting Part of a Text field in Query

B

bmistry

Hi,

I have a query that holds employee names which i am
planning on using in a mail merge to create letters to the
employees. However, the employee name is stored in the
format: [LastName,FirstName].

Is there anyway of switching the two around or exracting
the first and last names into seperate field. I know this
is capable in Exel using the MID, LEFT, RIGHT functions
together with the FIND function. However, the FIND
function doesn't work in the MS Acess Query.

Any help is much appreciated.

Many thanks

bmistry
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use the InStr() function in place of the Excel Find function. E.g.:

LastName: Left(Name, Instr(Name,",")-1)
FirstName: Mid(Name, Instr(Name, ",") + 1)

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQVB0AIechKqOuFEgEQLRYwCgoZGhSDXFO7hhhDj90VZLDdtiLZgAoI8L
BBT18zDm1WW2ddUyF2qet/nS
=p3P7
-----END PGP SIGNATURE-----
 
B

bmistry

Thanks so much - it worked perfectly!
-----Original Message-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use the InStr() function in place of the Excel Find function. E.g.:

LastName: Left(Name, Instr(Name,",")-1)
FirstName: Mid(Name, Instr(Name, ",") + 1)

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQVB0AIechKqOuFEgEQLRYwCgoZGhSDXFO7hhhDj90VZLDdtiLZ gAoI8L
BBT18zDm1WW2ddUyF2qet/nS
=p3P7
-----END PGP SIGNATURE-----

Hi,

I have a query that holds employee names which i am
planning on using in a mail merge to create letters to the
employees. However, the employee name is stored in the
format: [LastName,FirstName].

Is there anyway of switching the two around or exracting
the first and last names into seperate field. I know this
is capable in Exel using the MID, LEFT, RIGHT functions
together with the FIND function. However, the FIND
function doesn't work in the MS Acess Query.

.
 

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