UpDate Query

  • Thread starter Thread starter NotGood@All
  • Start date Start date
N

NotGood@All

I have a table that has 3 fields, Inmate Name, FirstName, & LastName. In the
Inmate Name field they have the whole name "Smith, John". I want to to put
Smith in the LastName column, and John in the FirstName column. I entered
LastName:left([Inmate Name]),instr([Inmate Name]),",")-1) but I get "wrong
number of arguments. Can someone help me? please
 
UPDATE Tablename
SET LastName = Left([Inmate Name], InStr([Inmate Name], ",") - 1),
FirstName = Mid([Inmate Name], InStr([Inmate Name], ",") + 1)
WHERE InStr([Inmate Name], ",") <> 0;
 
Hi,

You need to watch your parenthesis. Try:
LastName:left([Inmate Name],instr([Inmate Name],",")-1)

You should store the first and last names separately and then get rid of the
Inmate Name field which is redundant data.

Regards
Kevin
 
Back
Top