Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

Testing for a literal or a number

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JoeP - 25 May 2007 18:58 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.