Query Question

T

tom

I have a query with a field which strips numerics and
sometimes results with two numbers put together.

So for example I have two queries that I want to join.

Query 1 Query 2
123456 123
456

How do I do this?
 
R

Rick Brandt

tom said:
I have a query with a field which strips numerics and
sometimes results with two numbers put together.

So for example I have two queries that I want to join.

Query 1 Query 2
123456 123
456

How do I do this?

Do what? Join them? You haven't indicated what the desired output is and
that is required to know how the join should be constructed.
 
J

John W. Vinson

I have a query with a field which strips numerics and
sometimes results with two numbers put together.

So for example I have two queries that I want to join.

Query 1 Query 2
123456 123
456

How do I do this?

What would keep that from giving 12 and 3456, or 1234 and 56, or any of the
other possible decompositions as a result? What is your first query using, and
what is it "stripping numerics" from, and how? What are some other values of
the field, and how should THEY be split?

You could do this IF Query1 always contains 6 digit numbers, and you ALWAYS
want the first three digits and the last three digits in separate records:

SELECT Left([query1].[field1], 3) FROM query1
UNION ALL
SELECT Right([query1].field1], 3) FROM query1;

but I somehow suspect that not all the records of query1 are intended to be
partitioned in this manner!!
 

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