View Full Version : Check for number...Syntax


Ziggy1
11-19-2003, 06:50 AM
Help.... I can't figure out the syntax.


I can do it with VB but I just want a simple expression for this one.

I need to check the right most character for a number and if true put in a space and false put in the value.


Level1: IIf(isnumberic(Right([location],1) ,"",Mid([location],1)))

I've seen Isnumber, isnumeric suggested in other posts but Access Help isn't much help


Thanks

Ziggy

namliam
11-19-2003, 06:55 AM
isnumeric should work...

Mile-O
11-19-2003, 07:03 AM
IsNumeric is fine and the brackets are in the wrong place:

Level1: IIf(IsNumeric(Right([location],1)) ,"", Mid([location],1))

The only thing now is that Mid([location, 1) is the exact same as simply saying [location]

This what you want?

Level1: IIf(IsNumeric(Right([location],1)) ,"", [location])

namliam
11-19-2003, 07:26 AM
I usually spot things like that :( good one mile....

Ziggy1
11-19-2003, 07:30 AM
Thanks Mile-O-Phile ,

I kept getting mixed up on the brackets, the "False" condition should have also been with the "Right" function not "Mid", I edited the expression for the post.


So with your help this works for me:

Level1: IIf(IsNumeric(Right([location],1)),"",Right([location],1))


Thanks

Ziggy