modify Expression

Ziggy1

Registered User.
Local time
Today, 09:08
Joined
Feb 6, 2002
Messages
462
Hi Guys,

I'm using the expression below, return a value of 1 if the field contains a "K". this was a simple fix at the time because K was the only non integer character.

Now I need to modify it to check the field and if there is a non integer I want it to put in a One (or any other integer).




LOC1a: IIf(Mid([LOCATION],5,1)="K","1",Mid([LOCATION],5,1) Mod 2)


Thanks

Ziggy
 
Have you tried: IIf(Mid([LOCATION],5,1)>"9"
since all the "numbers" are less than the "letters" it should work.
 
Try working with Asc

IIf(asc(Mid([LOCATION],5,1))

Asc("0") = 48
Asc("9") = 57

Or even (much) easier:

isnumeric(Mid([LOCATION],5,1))

returns true or false :D

Regards

The mailman
 
Thanks for the Replies.

I'll have to try them out on Monday. I was part of the "Blackout" so I missed work on Friday, what an adventure that was!




Ziggy
 
Thanks again, I tried out both your solutions and they worked. This helps alot!

Ziggy
 

Users who are viewing this thread

Back
Top Bottom