Im trying to create and update query that will extract the state out of an address field, the address field containing "city state" (no comma). I have been messing with the instr, left, etc.. functions and I cannot seem to get it right. The closest I have gotten is using :
Right(Trim([ADDR2]),Len(Trim([ADDR2]))-InStr(InStr(1,[ADDR2]," ")+1,[ADDR2]," "))
But this only works if my city is 2 words. For example
'chester springs pa' returns 'pa'
'but malvern pa' returns 'malvern pa'
Can someone help me get this query right?!?!?!
Right(Trim([ADDR2]),Len(Trim([ADDR2]))-InStr(InStr(1,[ADDR2]," ")+1,[ADDR2]," "))
But this only works if my city is 2 words. For example
'chester springs pa' returns 'pa'
'but malvern pa' returns 'malvern pa'
Can someone help me get this query right?!?!?!
