I have a table that has codes like C345, B34B, C34A, and so on.
The last character is significant in that he identifes the plant location
that a part was produced.
I have done a query adding a column called LastChar using the Right function
to segregate the last character from the part number. My results are 5, B,
A, and so on.
What I would like to be able to do is add another column to the query called
TextorNumber that tests the items in the LastChar column and if it is a
number I want the letter X to appear. If it is not a number I want the value
from LastChar to appear.
Thanks for any help.
Arvin Meyer [MVP] - 25 May 2007 19:37 GMT
IIf (Right([FieldName],1) Between Chr(48) And Chr(57), "X",
Right([FieldName],1))

Signature
Arvin Meyer, MCP, MVP
Microsoft Access
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
>I have a table that has codes like C345, B34B, C34A, and so on.
> The last character is significant in that he identifes the plant location
[quoted text clipped - 11 lines]
> from LastChar to appear.
> Thanks for any help.
JJ32 - 25 May 2007 20:49 GMT
Why not just use IsNumeric()?
IIf(IsNumeric([LastChar]), "X", [LastChar])
JJ
> I have a table that has codes like C345, B34B, C34A, and so on.
> The last character is significant in that he identifes the plant location
[quoted text clipped - 7 lines]
> from LastChar to appear.
> Thanks for any help.