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  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Sending data from a query to a table in access..is this possible???

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-13-04, 14:47
doctor doctor is offline
Registered User
 
Join Date: Jun 2004
Posts: 20
Question Sending data from a query to a table in access..is this possible???

heey everyone,

I need some help sorting out data. I have 1 query returning 100+ results and i need to split that query up and save it into 2 access tables. how can i go about doing this?

I have 2 ideas..neither of which i know how to implement exactly ( thats where i need your help, unless you can think of a better way to do this...)

1) create a auto numbered main table put the results of the query in that table. have 2 other tables where the first takes 1-85, and the second takes 86-120 directly from a main table

Or

2)have the SQL statement send the data to the 2 tables using somthing like INSERT somehow..

If anyone can help me out Id highly appreciate it.

Thx
Doc
Reply With Quote
  #2 (permalink)  
Old 07-14-04, 05:14
Madhivanan Madhivanan is offline
Registered User
 
Join Date: Oct 2003
Posts: 357
Thumbs up

Hi,
Are the structure of the two tables same? Then try the following
Select top 100 from the table and insert them into the first table
Select rest of the records from the table and insert them into the second table

Madhivanan
Reply With Quote
  #3 (permalink)  
Old 07-14-04, 09:07
doctor doctor is offline
Registered User
 
Join Date: Jun 2004
Posts: 20
SELECT TOP 100
INSERT INTO table name


is this what you mean ? its not quite working for me, im putting that after the statement which fetches my 100+ results
Reply With Quote
  #4 (permalink)  
Old 07-14-04, 09:44
r123456 r123456 is offline
Registered User
 
Join Date: Sep 2003
Location: The extremely Royal borough of Kensington, London
Posts: 778
Select top 100 * Into newTable1 from oldTable where key NOT IN (select top 50 key from oldTable)
__________________
Bessie Braddock: Winston, you are drunk!
Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On