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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|