Excluding numeric values in Query Filter

S

Staten42

I am pulling data from an ODBC connection, and need to filter results based
on a specific field. This particular field includes both alpha and numeric
values and I only want it to pull in one or the other. Any thoughts?
 
J

Joel

Try putting a like clause into the SQL like this

WHERE (Submissions.Task_ID Like '[0-9]+')


the square brack will says to take any characters 0 through 9 and the plus
say to do it infinite number of times

Submission is a table in one of my database and Task_ID is a column in the
table.
 
S

Staten42

Is there a way of doing outside of altering the SQL statement?

Joel said:
Try putting a like clause into the SQL like this

WHERE (Submissions.Task_ID Like '[0-9]+')


the square brack will says to take any characters 0 through 9 and the plus
say to do it infinite number of times

Submission is a table in one of my database and Task_ID is a column in the
table.
Staten42 said:
I am pulling data from an ODBC connection, and need to filter results based
on a specific field. This particular field includes both alpha and numeric
values and I only want it to pull in one or the other. Any thoughts?
 
J

Joel

Why wouldn't uyou modifiy the SQL? I'm not sure if you understand my
response. The SQL is part of the Command text of the query and is the method
you use to filter data.


You can open the data as a recordset and read the data one record a time.
But again Why??????? If I knew why you don't want to use an SQL then maybe I
can give a better answer.


Staten42 said:
Is there a way of doing outside of altering the SQL statement?

Joel said:
Try putting a like clause into the SQL like this

WHERE (Submissions.Task_ID Like '[0-9]+')


the square brack will says to take any characters 0 through 9 and the plus
say to do it infinite number of times

Submission is a table in one of my database and Task_ID is a column in the
table.
Staten42 said:
I am pulling data from an ODBC connection, and need to filter results based
on a specific field. This particular field includes both alpha and numeric
values and I only want it to pull in one or the other. Any thoughts?
 
S

Staten42

I apologize for not being more clear. I would prefer not to modify the SQL
manually, as I am not very well versed in SQL, and was hoping I might be able
to do it via the Wizard.....

Joel said:
Why wouldn't uyou modifiy the SQL? I'm not sure if you understand my
response. The SQL is part of the Command text of the query and is the method
you use to filter data.


You can open the data as a recordset and read the data one record a time.
But again Why??????? If I knew why you don't want to use an SQL then maybe I
can give a better answer.


Staten42 said:
Is there a way of doing outside of altering the SQL statement?

Joel said:
Try putting a like clause into the SQL like this

WHERE (Submissions.Task_ID Like '[0-9]+')


the square brack will says to take any characters 0 through 9 and the plus
say to do it infinite number of times

Submission is a table in one of my database and Task_ID is a column in the
table.
:

I am pulling data from an ODBC connection, and need to filter results based
on a specific field. This particular field includes both alpha and numeric
values and I only want it to pull in one or the other. Any thoughts?
 
J

Joel

Yes you can use the filter in the query. Just select the type as "LIKE and
then in the box next to the like put in the following

[0-9]+



Staten42 said:
I apologize for not being more clear. I would prefer not to modify the SQL
manually, as I am not very well versed in SQL, and was hoping I might be able
to do it via the Wizard.....

Joel said:
Why wouldn't uyou modifiy the SQL? I'm not sure if you understand my
response. The SQL is part of the Command text of the query and is the method
you use to filter data.


You can open the data as a recordset and read the data one record a time.
But again Why??????? If I knew why you don't want to use an SQL then maybe I
can give a better answer.


Staten42 said:
Is there a way of doing outside of altering the SQL statement?

:

Try putting a like clause into the SQL like this

WHERE (Submissions.Task_ID Like '[0-9]+')


the square brack will says to take any characters 0 through 9 and the plus
say to do it infinite number of times

Submission is a table in one of my database and Task_ID is a column in the
table.
:

I am pulling data from an ODBC connection, and need to filter results based
on a specific field. This particular field includes both alpha and numeric
values and I only want it to pull in one or the other. Any thoughts?
 
J

Joel

for non-numeric string you want anything that doesn't start with a digit
which is this

^[0-9]*

where the charat is to excelue anything that starts with 0 to 9 folowed by
anything

Staten42 said:
I apologize for not being more clear. I would prefer not to modify the SQL
manually, as I am not very well versed in SQL, and was hoping I might be able
to do it via the Wizard.....

Joel said:
Why wouldn't uyou modifiy the SQL? I'm not sure if you understand my
response. The SQL is part of the Command text of the query and is the method
you use to filter data.


You can open the data as a recordset and read the data one record a time.
But again Why??????? If I knew why you don't want to use an SQL then maybe I
can give a better answer.


Staten42 said:
Is there a way of doing outside of altering the SQL statement?

:

Try putting a like clause into the SQL like this

WHERE (Submissions.Task_ID Like '[0-9]+')


the square brack will says to take any characters 0 through 9 and the plus
say to do it infinite number of times

Submission is a table in one of my database and Task_ID is a column in the
table.
:

I am pulling data from an ODBC connection, and need to filter results based
on a specific field. This particular field includes both alpha and numeric
values and I only want it to pull in one or the other. Any thoughts?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top