Return Alphanumeric values only (1 Viewer)

Sinoe

Registered User.
Local time
Today, 02:20
Joined
Mar 31, 2015
Messages
25
Hi smart people,

Can anyone tell me how to write an expression/criteria in a query that will return only ID numbers with alpha numeric values. Example: My Id field contains both numeric 479621, 680530 and alpha numeric 132NAV100, 174NAV26a values. I want to run the query to return only the alpha numeric values.

Thanks.

P.S. I do not know SQL nor VBA.
 

jdraw

Super Moderator
Staff member
Local time
Today, 05:20
Joined
Jan 23, 2006
Messages
15,394
What , if anything, do you want returned from 132NAV100?
 

Sinoe

Registered User.
Local time
Today, 02:20
Joined
Mar 31, 2015
Messages
25
Thanks for responding so quickly. 132NAV100 is just one of the ID numbers in the table. I want to run the query to return ID numbers like this and not ID number that just have numbers, like 12345 or 7891, etc.

Thank you.
 

Sinoe

Registered User.
Local time
Today, 02:20
Joined
Mar 31, 2015
Messages
25
Thanks jdraw.

I tried IsNumeric but it did not work. It actually returned no result.
 

jdraw

Super Moderator
Staff member
Local time
Today, 05:20
Joined
Jan 23, 2006
Messages
15,394
Please post the SQL of the query you tried.
Go to query designer, click sql view, copy and paste what you see.
 

Sinoe

Registered User.
Local time
Today, 02:20
Joined
Mar 31, 2015
Messages
25
Here is the SQL statement. This returns result but include the numeric as well as the alpha numeric id numbers.

SELECT [Navigator data MAY 7-13].[Last Name], [Navigator data MAY 7-13].[First Name], [Navigator data MAY 7-13].[Assister ID], [Navigator data MAY 7-13].[Assister Org Name]
FROM [Navigator data MAY 7-13]
WHERE ((([Navigator data MAY 7-13].[Assister Org Name]) Is Not Null)) OR ((([Navigator data MAY 7-13].[Assister ID])=IsNumeric("ID")));
 

jdraw

Super Moderator
Staff member
Local time
Today, 05:20
Joined
Jan 23, 2006
Messages
15,394
I think this is what you want. However, the use of NOT gets you into
DeMorgans Law
Code:
SELECT [Navigator data MAY 7-13].[Last Name]
	,[Navigator data MAY 7-13].[First Name]
	,[Navigator data MAY 7-13].[Assister ID]
	,[Navigator data MAY 7-13].[Assister Org Name]
FROM [Navigator data MAY 7-13]
WHERE NOT (
		([Navigator data MAY 7-13].[Assister Org Name]) IS NULL
		OR (IsNumeric([Navigator data MAY 7-13].[Assister ID]))
		);

Do you want records where
OrgName is not Null and AssisterID is NOT Numeric?

Try the above sql. If it doesn't give hat you need, then change the OR to AND.
 

Sinoe

Registered User.
Local time
Today, 02:20
Joined
Mar 31, 2015
Messages
25
jdraw,

Thank you so much. It worked!!!!
 

jdraw

Super Moderator
Staff member
Local time
Today, 05:20
Joined
Jan 23, 2006
Messages
15,394
Glad you have it sorted. Happy to help.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 19:20
Joined
Jan 20, 2009
Messages
12,856
IsNumeric is a VBA function so processing it would require testing every record. Performance would be better by sticking with SQL.

This will return any record where the field holds alpha characters.

Code:
WHERE [Assister ID] Like "*[a-z]*"
 

Users who are viewing this thread

Top Bottom