Maintaining order in Make Table Query (1 Viewer)

Nevsky78

Registered User.
Local time
Today, 04:11
Joined
Mar 15, 2010
Messages
110
Hi all,

Just a quick one - does anyone know how to maintain the existing order of rows when running a Make Table query?

It's a very simple one - here's the code

Code:
SELECT [CLP Forecast Feed].[Item Code], [CLP Forecast Feed].[Description  ], [CLP Forecast Feed].Brand, [CLP Forecast Feed].[Proteus Product Group], [CLP Forecast Feed].[2011 Item Status], [CLP Forecast Feed].[Brand Category], [CLP Forecast Feed].[Milestone  Date], [CLP Forecast Feed].[Purchase  Currency], [CLP Forecast Feed].[Country of Origin], [CLP Forecast Feed].[Supplier  Name], [CLP Forecast Feed].[Shipment  Terms], [CLP Forecast Feed].[Payment  Terms], [CLP Forecast Feed].[2011 Ex Fact Cost], [CLP Forecast Feed].[2011 FCL Cost], [CLP Forecast Feed].[2011 LCL Cost], [CLP Forecast Feed].[Inner  Qty], [CLP Forecast Feed].[Mast  Ctn], [CLP Forecast Feed].[Master  Cu Ft], [CLP Forecast Feed].[Master  CBM], [CLP Forecast Feed].[Per 40ft  Container], [CLP Forecast Feed].[Freight  Cost], [CLP Forecast Feed].[Tariff  Code], [CLP Forecast Feed].[Duty  Rate], [CLP Forecast Feed].insure, [CLP Forecast Feed].[Lead Time ], [CLP Forecast Feed].[VAT Rate ], [CLP Forecast Feed].[Supplier Item Code ], [CLP Forecast Feed].[Landed Cost], [CLP Forecast Feed].[Calcul List Price], [CLP Forecast Feed].[List S/S Price], [CLP Forecast Feed].[List A/W Price], [CLP Forecast Feed].[Flair  Margin], [CLP Forecast Feed].[SRP  Price], [CLP Forecast Feed].[Retailer  Margin], [CLP Forecast Feed].[Purchase  Price], [CLP Forecast Feed].[Nominal Code  ], [CLP Forecast Feed].[Misc 1], [CLP Forecast Feed].[Misc 2], [CLP Forecast Feed].Check, [CLP Forecast Feed].Inventory, [CLP Forecast Feed].Forecast, [CLP Forecast Feed].[No Inventory], [CLP Forecast Feed].Comments, [CLP Forecast Feed].[FOB Cost], [CLP Forecast Feed].[Royalty UK], [CLP Forecast Feed].[Royalty FOB], [CLP Forecast Feed].[FOB Price], [CLP Forecast Feed].[Stock Status Check], [CLP Forecast Feed].[2012], [CLP Forecast Feed].[2012 Comments] INTO CLP
FROM [CLP Forecast Feed];
 

DCrake

Remembered
Local time
Today, 04:11
Joined
Jun 8, 2005
Messages
8,626
Why do you need to worry about the order? Use a query to define the order.
 

boblarson

Smeghead
Local time
Yesterday, 20:11
Joined
Jan 12, 2001
Messages
32,059
Just to give a little more info to you, Tables do not store data in any particular order. If you want to have order you need to provide that using a QUERY to pull data when you want it. Remember this - you can use a QUERY in 99.9% of the places you could use a table. So, instead of using a table for whatever it is you are going to use, use the query instead. So that begs the question, "Do you really need a make-table query to begin with?" You might be able to just use the query that is making the table if turned into a Select Query and an ORDER BY put on it.
 

the_net_2.0

Banned
Local time
Yesterday, 22:11
Joined
Sep 6, 2010
Messages
812
Hi all,

Just a quick one - does anyone know how to maintain the existing order of rows when running a Make Table query?

It's a very simple one - here's the code

Code:
SELECT [CLP Forecast Feed].[Item Code], [CLP Forecast Feed].[Description  ], [CLP Forecast Feed].Brand, [CLP Forecast Feed].[Proteus Product Group], [CLP Forecast Feed].[2011 Item Status], [CLP Forecast Feed].[Brand Category], [CLP Forecast Feed].[Milestone  Date], [CLP Forecast Feed].[Purchase  Currency], [CLP Forecast Feed].[Country of Origin], [CLP Forecast Feed].[Supplier  Name], [CLP Forecast Feed].[Shipment  Terms], [CLP Forecast Feed].[Payment  Terms], [CLP Forecast Feed].[2011 Ex Fact Cost], [CLP Forecast Feed].[2011 FCL Cost], [CLP Forecast Feed].[2011 LCL Cost], [CLP Forecast Feed].[Inner  Qty], [CLP Forecast Feed].[Mast  Ctn], [CLP Forecast Feed].[Master  Cu Ft], [CLP Forecast Feed].[Master  CBM], [CLP Forecast Feed].[Per 40ft  Container], [CLP Forecast Feed].[Freight  Cost], [CLP Forecast Feed].[Tariff  Code], [CLP Forecast Feed].[Duty  Rate], [CLP Forecast Feed].insure, [CLP Forecast Feed].[Lead Time ], [CLP Forecast Feed].[VAT Rate ], [CLP Forecast Feed].[Supplier Item Code ], [CLP Forecast Feed].[Landed Cost], [CLP Forecast Feed].[Calcul List Price], [CLP Forecast Feed].[List S/S Price], [CLP Forecast Feed].[List A/W Price], [CLP Forecast Feed].[Flair  Margin], [CLP Forecast Feed].[SRP  Price], [CLP Forecast Feed].[Retailer  Margin], [CLP Forecast Feed].[Purchase  Price], [CLP Forecast Feed].[Nominal Code  ], [CLP Forecast Feed].[Misc 1], [CLP Forecast Feed].[Misc 2], [CLP Forecast Feed].Check, [CLP Forecast Feed].Inventory, [CLP Forecast Feed].Forecast, [CLP Forecast Feed].[No Inventory], [CLP Forecast Feed].Comments, [CLP Forecast Feed].[FOB Cost], [CLP Forecast Feed].[Royalty UK], [CLP Forecast Feed].[Royalty FOB], [CLP Forecast Feed].[FOB Price], [CLP Forecast Feed].[Stock Status Check], [CLP Forecast Feed].[2012], [CLP Forecast Feed].[2012 Comments] INTO CLP
FROM [CLP Forecast Feed];

I'm also curious. How is the data different when it makes the table? How was it different in the source table it came from? It seems as though this acts differently than an Append query. Appended records, by default, do not adhere to a table's ordering structure and indexes, unless of course there is an autonumber PK in it.
 

Users who are viewing this thread

Top Bottom