Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exclude any number in a field? 4

Status
Not open for further replies.

tyleri

Programmer
Jan 2, 2001
173
US
I have a certain field that just happens to have 2 different datatypes in the same field. There was a mistake on the website and 2 different criteria were sent to the same field (not my fault).

The easiest way to sort these out: - one type has text with numbers, while the other type only has characters from the alphabet, there are NO numbers in the criteria.

So - I would like to know how it would be possible to make a query that only shows a field if it has NO numbers in it. Only characters from the alphabet.

Any ideas?

 
Cool that works for some of the data - but let me clarify my situation a little.

Company Names got mixed in with Addresses.

So - what I want this to show is this:

Field 1 Field 2

P.O. Box 2343 Address
1 United Drive Address
Company of Companies, Inc. Company


 
Yeah that's exactly what I have - it only picks up fields with numbers at the beginning of the phrase for the "Address" selection - for the P.O. Box example it gives me "Company" Becasue it doesn't start with a number, but a letter... This probably can't be done, can it?
 
I don't know how, but I'm sure it can be done. Don't give up hope :)
 

You can do this to select only records that have no numerics in them.

Select * From table Where Field1 Not Like "*[0-9]*"

Or you can determine if the column is a company or address like this.

In the query designer grid
Field2: IIf([Field1] Like "*[0-9]*","Address","Company")

The SQL statement
Select Field1,
IIf([Field1] Like "*[0-9]*", "Address", "Company") As Field2
From Table Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
I was going to say "I'm sure tlbroadbent can tell you how."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top