Select All Numbers

Dominato

Registered User.
Local time
Today, 21:46
Joined
Apr 10, 2002
Messages
19
I have a column called Name that is a string. I need a query that will select all records that begin with any non-alphabetical character (basically, any record that doesn't start with A-Z). Example:

#sample
3sample
joe
sally
~!sample

Should Return:
#sample
3sample
~!sample

The query will eventually be used for SQL Server, in case the matters. Thanks for any help.
 
Try:

Public Function IsNonAlpha(bytAscCode as byte) as Boolean

If bytAscCode >= 65 and bytChar<=90 then
IsNonAlpha = False
Else
IsNonAlpha = True
End if

End Function


Then in the query give the column this expression:

NonAlpha: IsNonAlpha(Asc(Left([FieldName],1)))

and put TRUE as the criteria for the column.


BIG TIP: Don't call the field 'name', it is a reserved word and will cause huge problems later down the track, trust me.
 

Users who are viewing this thread

Back
Top Bottom