Union query

E

Eva

Hi
I have two querries that are the same, except I have the criteria:
- on column called Ble service - one query asks for items "TTO" the other
for "OPPO"
When I try to union both queries into one using sql (union all) then on the
result the query asks for bble service - I can just type enter and have the
result of the query, but I want to skip it - I just want to click to my union
query and see the results.
I am doing something wrong that it asks me for it?
Thank you
 
K

KARL DEWEY

If I understand correctly you do not need a union.
Try this --
SELECT YourTable.*
FROM YourTable
WHERE YourTable.[Ble service] = "TTO" OR YourTable.[Ble service] = "OPPO";

You used [Ble service] and [Bble service] and that is probably why it ask
you to enter a response.
 
E

Eva

Hi Karl
Thank you for your response. I have in both column called Ble service (there
was a typo), and I tried your suggestion and I got the syntax error message.

If I have two queries I don't need union to join them as one? (the reason I
have two queries that headings are the same is that the information presented
there is different so I coudn't do it in one query)
--
Greatly appreciated
Eva


KARL DEWEY said:
If I understand correctly you do not need a union.
Try this --
SELECT YourTable.*
FROM YourTable
WHERE YourTable.[Ble service] = "TTO" OR YourTable.[Ble service] = "OPPO";

You used [Ble service] and [Bble service] and that is probably why it ask
you to enter a response.

--
Build a little, test a little.


Eva said:
Hi
I have two querries that are the same, except I have the criteria:
- on column called Ble service - one query asks for items "TTO" the other
for "OPPO"
When I try to union both queries into one using sql (union all) then on the
result the query asks for bble service - I can just type enter and have the
result of the query, but I want to skip it - I just want to click to my union
query and see the results.
I am doing something wrong that it asks me for it?
Thank you
 
E

Eva

It works now! thanks both of you !
--
Greatly appreciated
Eva


KenSheridan via AccessMonster.com said:
Eva:

If it is prompting for "bble service" could this be a typo in the query for
"Ble service", which you say is the column name.

But, if both parts are the same apart from the criteria on the column why do
you need a UNION ALL operation at all for this? Can't it be done with:

SELECT *
FROM [YourTable]
WHERE [Ble service] = "TTO"
OR [Ble service] = "OPPO";

Ken Sheridan
Stafford, England
Hi
I have two querries that are the same, except I have the criteria:
- on column called Ble service - one query asks for items "TTO" the other
for "OPPO"
When I try to union both queries into one using sql (union all) then on the
result the query asks for bble service - I can just type enter and have the
result of the query, but I want to skip it - I just want to click to my union
query and see the results.
I am doing something wrong that it asks me for it?
Thank you
 
E

Eva

I just tested it and it doesn't work the way I wanted. I will explain more
about my queries. Both of them have same headings, but the data is organized
differently and it depends on the ble service code.For example in both
queries there is a column Code 1 -but in one I need to show bble customer
under this heading, and on the other one I need to have there bble product.
This is why I created both queries and this is why I need to union them. I
know it is stupid, but this is the way how it should be done. So when I did
what you suggested first I thought that it is fine, but when I run the query
I found out that then all data are organized the same, whis is not what I
want.
--
Greatly appreciated
Eva


Eva said:
It works now! thanks both of you !
--
Greatly appreciated
Eva


KenSheridan via AccessMonster.com said:
Eva:

If it is prompting for "bble service" could this be a typo in the query for
"Ble service", which you say is the column name.

But, if both parts are the same apart from the criteria on the column why do
you need a UNION ALL operation at all for this? Can't it be done with:

SELECT *
FROM [YourTable]
WHERE [Ble service] = "TTO"
OR [Ble service] = "OPPO";

Ken Sheridan
Stafford, England
Hi
I have two querries that are the same, except I have the criteria:
- on column called Ble service - one query asks for items "TTO" the other
for "OPPO"
When I try to union both queries into one using sql (union all) then on the
result the query asks for bble service - I can just type enter and have the
result of the query, but I want to skip it - I just want to click to my union
query and see the results.
I am doing something wrong that it asks me for it?
Thank you
 
K

KARL DEWEY

Post your two queries.
--
Build a little, test a little.


Eva said:
I just tested it and it doesn't work the way I wanted. I will explain more
about my queries. Both of them have same headings, but the data is organized
differently and it depends on the ble service code.For example in both
queries there is a column Code 1 -but in one I need to show bble customer
under this heading, and on the other one I need to have there bble product.
This is why I created both queries and this is why I need to union them. I
know it is stupid, but this is the way how it should be done. So when I did
what you suggested first I thought that it is fine, but when I run the query
I found out that then all data are organized the same, whis is not what I
want.
--
Greatly appreciated
Eva


Eva said:
It works now! thanks both of you !
--
Greatly appreciated
Eva


KenSheridan via AccessMonster.com said:
Eva:

If it is prompting for "bble service" could this be a typo in the query for
"Ble service", which you say is the column name.

But, if both parts are the same apart from the criteria on the column why do
you need a UNION ALL operation at all for this? Can't it be done with:

SELECT *
FROM [YourTable]
WHERE [Ble service] = "TTO"
OR [Ble service] = "OPPO";

Ken Sheridan
Stafford, England

Eva wrote:
Hi
I have two querries that are the same, except I have the criteria:
- on column called Ble service - one query asks for items "TTO" the other
for "OPPO"
When I try to union both queries into one using sql (union all) then on the
result the query asks for bble service - I can just type enter and have the
result of the query, but I want to skip it - I just want to click to my union
query and see the results.
I am doing something wrong that it asks me for it?
Thank you
 

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

Similar Threads


Top