Access Check if a string field contains a char before doing something with it -


my problem rather simple (i think), can't make work. have numbers in field 1;2.3 1;2.3 - 4;5.6 have is: if there '-' char, first part (1;2.3). otherwise whole thing. did left part

left([age_years];instr(1;[age_years];" - ")-1)) 

but when there 1 part gives me #func! result. tried

mths: iif(instr([age_years]>0;"-");[age_years];left([age_years];instr(1;[age_years];" - ")-1)) 

but didn't work @ all. gave me bunch of #error!, , cannt see i'm doing wrong.

help please!

how about:

iif(instr([age_years];"-")=0;[age_years];left([age_years];instr(1;[age_years];" - ")-1)) 

you need decide between " - " , "-", have left it, should pick one.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -