I was trying to move data from one field to another in an ArcMap 10 layer using Field Calculator and ran into problems. I'm sure it is a syntax thing as I am not that well versed in VB, but Google failed me so I turn to you.
Data in field I'll be moving is formated as:
9500 Lowland Woods Blvd, Any City, Fl 99999
How I want it to look in the new field is:
9500 Lowland Woods Blvd
My first pass was to use LEFT with Instr to identify the limit. I put into Field Calculator:
Code: Select all
Left( [CrisisAddr], InStr( [CrisisAddr],","))
It returned:
9500 Lowland Woods Blvd,
As you can see it brought the comma over with it. I wanted to see if I could add a -1 to the InStr function.
InStr( [CrisisAddr],",") gave me a value of 25
InStr( [CrisisAddr],",")-1 gave me a value of 24
so far so good
But when I tried to incorporate that into the Field Calculator statement it errors.
Code: Select all
Left([CrisisAddr],( InStr( [CrisisAddr],",")-1))
Error statement: Invalid Procedure call or argument "Left"
I know it has to be an syntax error or abuse of the parans, but for the life of me I cannot figure it out. It's an academic question now as I did find a work around.
Spoiler:
But I would really like to know if it is possible to do this and what the syntax is.
Just for the record I tried this also:
Spoiler:
If anyone could point out my ridiculously simple error I would appreciate it.