How to do this?

wind54surfer

Registered User.
Local time
Today, 15:45
Joined
Jan 19, 2005
Messages
31
Hi all, I am trying to show records that have more than just numbers.

If I have:

4536
3452C
7642-B
2314
Thomas
5432

I need to show only:

3452C
7642-B
Thomas

Don't know where to start.
Any help really appreciated.
 
VBA has an IsNumeric() function.
 
laughing...

this works, but it's really sloppy:

query SQL:
PHP:
SELECT Table.Field

FROM Table

WHERE iif(checkforalpha(table.field) = -1, table.field, null) is not null
write a new function to help yourself out:
PHP:
Function checkforalpha(str As String) As Boolean

Dim i As Long

For i = 1 To Len(str)
    If Not IsNumeric(Mid(str, i, 1)) Then
        checkforalpha = True
            Exit Function
    End If
Next i

checkforalpha = False

End Function
I forgot to tell you that NOT numeric also means things like "-", "*", "^". If you wanna use this without a chance of error, get the CHR() value range for letters A-Z and check that instead of ISNUMERIC()
 
Last edited:
Thank you very much to everybody that mentioned "IsNumeric"

I ended up doing it as simple as possible for my purpose, making a query to add to my larger query:

SELECT Orders.OrderID
FROM Orders
WHERE (((IsNumeric([OrderID]))=False));

Thanks again!
 

Users who are viewing this thread

Back
Top Bottom