View Full Version : Please help string parse


ksaab
11-11-2005, 01:49 PM
Probably very simple but I cannot get the syntax right - it has been far too long since I used Access.

I am trying to seperate a field NAME from these formats:

LAST/FIRST M
LAST/FIRST

To two fields: Field LAST and field FIRST

Can someone please help?

Thank you! It is Friday and I want to go home!

raskew
11-11-2005, 03:55 PM
'First' and 'Last' are the names of native functions and, as such, are reserved words as is 'Name'. Best to rename your fields to avoid future problems (I'll use xFirst, xLast and xName to illustrate):

From the debug (immediate) window:

xName = "LAST/FIRST M"
xLast = left(xName, instr(xname, "/")-1)
? xLast
LAST

xFirst = mid(xName, instr(xName, "/") +1)
? xFirst
FIRST M


HTH - Bob