Query Help

G

GeoDude

I need help designing a query. I have file names in a table in a text
format, here is an example of my data: 103B 1000 202A 300 25 1A etc..
I would like a query to pull all file names that do not have a letter
associated with them.

Thank You
 
W

Wayne Morgan

The IsNumeric function should do what you want.

SELECT Table1.Field1
FROM Table1
WHERE IsNumeric([Table1].[Field1])=True;
 
J

John Vinson

I need help designing a query. I have file names in a table in a text
format, here is an example of my data: 103B 1000 202A 300 25 1A etc..
I would like a query to pull all file names that do not have a letter
associated with them.

Thank You

Assuming that this is a table with one filename per record in the
field [Filename], try creating a Query based on the table. Include
[Filename] and in a vacant Field cell type

IsNum: IsNumeric([Filename])

On the criteria line under this field type True.

John W. Vinson[MVP]
 
G

GeoDude

When I typed in the query I recieved no results. Did I type it in
correctly?

Thanks for the help

SELECT Wells.WellName
FROM Wells
WHERE ((IsNumeric([Wells]![WellName])="True"));


The IsNumeric function should do what you want.

SELECT Table1.Field1
FROM Table1
WHERE IsNumeric([Table1].[Field1])=True;
 
J

John Vinson

When I typed in the query I recieved no results. Did I type it in
correctly?

Thanks for the help

SELECT Wells.WellName
FROM Wells
WHERE ((IsNumeric([Wells]![WellName])="True"));

Two errors:

- The ! mark is used for Form or other object references; you should
use a period instead for table/field references.
- Remove the quotemarks. A yes/no result is not a text string; the
IsNumeric function returns -1 (which has True as a synonym) or 0 (also
represented by the word False).

Actually, since a WHERE clause returns the record if it evaluates to a
true expression, not if it doesn't, you can leave off the equality
altogether:

SELECT Wells.WellName
From Wells
WHERE IsNumeric([Wells].[WellName]);

John W. Vinson[MVP]
 
Top