Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 7th, 2007, 09:22 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Split Query Results

I have a query and the results i want to split them into a new table. lets say the query has 4 fields.

A B C D E F G H

i want to append these in a table like this

1st row of the table = A B C D
2nd row of the table = E F G H

and it has to go trhouh the whole query for all the rows to do the same thing.

Thank you in advance.
  #2 (permalink)  
Old February 7th, 2007, 10:37 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You say the query has four field, and then list 8 items.

Can you post the query SQL, and some results?



mmcdonal
  #3 (permalink)  
Old June 1st, 2007, 10:08 AM
pjm pjm is offline
Authorized User
 
Join Date: Jul 2006
Location: Boston, MA, USA.
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Default

By now you probably have already figured it out (or ditched that line of inquiry) but I think that a union query might do the trick:

SELECT A as Field1, B as Field2, C as Field3, D as Field4
FROM YourTable
UNION
SELECT E as Field1, F as Field2, G as Field3, H as Field4
FROM YourTable;


-Phil-


Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit Query Results in Results Grid druid2112 SQL Server 2005 1 June 28th, 2007 08:49 AM
results shown by query Vince_421 Access 1 February 4th, 2007 12:45 PM
different results were given for the same query madhusrp SQL Server 2000 2 May 9th, 2006 01:54 AM
Crosstab query with no results edubbelaar Access 0 November 22nd, 2004 06:12 AM
Refresh Query Results Ben Access VBA 2 February 10th, 2004 10:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.