Pulling numeric data out of text field

C

Castor5150

This may be a really basic question but does anyone have any idea how I can
pull only the numeric data out of a text field in Access? For example there
are stock numbers such as 800795999 and 89556FG86 but I only need to get the
stock numbers with numbers, no letters, any ideas? Thanks
 
J

John Vinson

This may be a really basic question but does anyone have any idea how I can
pull only the numeric data out of a text field in Access? For example there
are stock numbers such as 800795999 and 89556FG86 but I only need to get the
stock numbers with numbers, no letters, any ideas? Thanks

Use a query criterion

NOT LIKE "*[A-Z]*"


John W. Vinson[MVP]
 
S

Stub932

Just further to that question:
How can I search for a street name only, if an address field has both the
street number and street name in it.
If there is an entry say... 123 Main Street and I want to input in the
search box "Main" or "Main Street", what would be the query criteria?


John Vinson said:
This may be a really basic question but does anyone have any idea how I can
pull only the numeric data out of a text field in Access? For example there
are stock numbers such as 800795999 and 89556FG86 but I only need to get the
stock numbers with numbers, no letters, any ideas? Thanks

Use a query criterion

NOT LIKE "*[A-Z]*"


John W. Vinson[MVP]
 
D

Douglas J. Steele

LIKE "*Main*"

or

LIKE "*Main Street*"

If you're trying to have a parameter box pop up, set the criteria of your
query to:

LIKE "*" & [What Street?] & "*"

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Stub932 said:
Just further to that question:
How can I search for a street name only, if an address field has both the
street number and street name in it.
If there is an entry say... 123 Main Street and I want to input in
the
search box "Main" or "Main Street", what would be the query criteria?


John Vinson said:
This may be a really basic question but does anyone have any idea how I can
pull only the numeric data out of a text field in Access? For example there
are stock numbers such as 800795999 and 89556FG86 but I only need to get the
stock numbers with numbers, no letters, any ideas? Thanks

Use a query criterion

NOT LIKE "*[A-Z]*"


John W. Vinson[MVP]
 
Top