Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access 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 March 2nd, 2008, 07:03 PM
Authorized User
 
Join Date: Apr 2006
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cross-Tab query

Hi,

Is it possible to transform an Access cross-tab query to a table?

Example:

Cross-tab query returns:

Company South North West East
Comp1 10 11 12 14
Comp2 15 16 17 18
Comp3 19 20 21 22

I want to end up with a table which has the following fields:

Company
South
North
West
East

Thanks
Sayed

Last edited by subhanak; December 21st, 2009 at 10:50 AM..
  #2 (permalink)  
Old March 3rd, 2008, 09: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

Can you open the query in designer view, and then click Query in the text menu, and then select Make Table query. This will make a table from your query results, which is good for the first run. Then change the query to an Append query for subsequent runs. Then also create a delete query for the new table. Then each time you want to fill the table, do this with your code:

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryDELETEmyNewTable"
DoCmd.OpenQuery "qryAPPENDmyXTabData"
DoCmd.SetWarnings True

This will clean out old data, and repopulate your table with new data. Then DoCmd.OpeReport etc.

Did that help?



mmcdonal

Look it up at: http://wrox.books24x7.com
  #3 (permalink)  
Old March 3rd, 2008, 06:50 PM
Authorized User
 
Join Date: Apr 2006
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Sir!

I have got the following answer from another site:(it works fine)

Create a new query that is based on your existing crosstab query. Make the new query a 'make table' query (see menu option Query > Make Table Query) and follow the on-screen steps.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Cross-Tab query in SQL? WebLadyBug SQL Server ASP 0 March 9th, 2007 09:57 AM
Cross Tab query aware SQL Server 2000 3 June 29th, 2006 04:22 PM
cross tab help drachx SQL Server 2000 3 October 24th, 2005 03:26 PM
cross tab s_a_ravi BOOK: Professional Crystal Reports for VS.NET 0 February 17th, 2005 06:49 AM
Cross Tab ? abdusalam Crystal Reports 2 July 25th, 2004 11:44 PM





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