A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Union Query Not writing to table



 
 
Thread Tools Display Modes
  #1  
Old December 28th, 2006, 01:24 AM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 1
Default Union Query Not writing to table

I have a union query that is quite simple:

SELECT DetailCust.OrderNumber,
Mid(DetailCust.ProductCode,3,2)+MID(DetailCust.Pro ductCode,7,2) AS Expr1,
DetailCust.Quantity, DetailCust.UnitPrice, DetailCust.ExtendedPrice
FROM DetailCust
WHERE (((DetailCust.ProductCode) Like "tbjm*"));
UNION
SELECT DetailCust.OrderNumber,
Left(DetailCust.ProductCode,2)+MID(DetailCust.Prod uctCode,5,2) AS Expr1,
DetailCust.Quantity, DetailCust.UnitPrice, DetailCust.ExtendedPrice
FROM DetailCust
WHERE (((DetailCust.ProductCode) Like "tbjm*"));

The query runs great an I get the data I am expecting. How do I save it in
the table, or do I have to add it to another table?

Brian
  #2  
Old December 28th, 2006, 02:30 AM posted to microsoft.public.access.queries
Amy Blankenship
external usenet poster
 
Posts: 539
Default Union Query Not writing to table

Why do you need to store the information again, since you already have it
and have no trouble querying it?

wrote in message
...
I have a union query that is quite simple:

SELECT DetailCust.OrderNumber,
Mid(DetailCust.ProductCode,3,2)+MID(DetailCust.Pro ductCode,7,2) AS Expr1,
DetailCust.Quantity, DetailCust.UnitPrice, DetailCust.ExtendedPrice
FROM DetailCust
WHERE (((DetailCust.ProductCode) Like "tbjm*"));
UNION
SELECT DetailCust.OrderNumber,
Left(DetailCust.ProductCode,2)+MID(DetailCust.Prod uctCode,5,2) AS Expr1,
DetailCust.Quantity, DetailCust.UnitPrice, DetailCust.ExtendedPrice
FROM DetailCust
WHERE (((DetailCust.ProductCode) Like "tbjm*"));

The query runs great an I get the data I am expecting. How do I save it in
the table, or do I have to add it to another table?

Brian



  #3  
Old December 28th, 2006, 03:12 AM posted to microsoft.public.access.queries
'69 Camaro
external usenet poster
 
Posts: 1,049
Default Union Query Not writing to table

Hi, Brian.

How do I save it in
the table


Save the UNION query, then create a new make table query with the UNION query as
the data source. For example:

SELECT * INTO NewTable
FROM qryUnion;

.. . . where NewTable is the name of the new table you want to create and
qryUnion is the name of your UNION query.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.


wrote in message
...
I have a union query that is quite simple:

SELECT DetailCust.OrderNumber,
Mid(DetailCust.ProductCode,3,2)+MID(DetailCust.Pro ductCode,7,2) AS Expr1,
DetailCust.Quantity, DetailCust.UnitPrice, DetailCust.ExtendedPrice
FROM DetailCust
WHERE (((DetailCust.ProductCode) Like "tbjm*"));
UNION
SELECT DetailCust.OrderNumber, The query runs great an I get the data I am
expecting. How do I save it in
the table
Left(DetailCust.ProductCode,2)+MID(DetailCust.Prod uctCode,5,2) AS Expr1,
DetailCust.Quantity, DetailCust.UnitPrice, DetailCust.ExtendedPrice
FROM DetailCust
WHERE (((DetailCust.ProductCode) Like "tbjm*"));

, or do I have to add it to another table?

Brian



  #4  
Old December 28th, 2006, 12:53 PM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 1
Default Union Query Not writing to table

The reason dor the save is that the customer Ireceive the data from uses
codes for the products. In this case the code in this example is for two
products which I split so the inventory can read the products. The TBJM* is
actually TBJM4001 which needs to split to TB40 and JM01. These are the
actual products I would ship.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:29 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.