Results 1 to 4 of 4
  1. #1
    Meh is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    3

    Cross Tab query takes long time to execute


    Hello

    I have the below cross tab query which takes 4-5 minutes to execute,


    TRANSFORM Sum([1].[8 oz Case Equivalents]) AS [SumOf8 oz Case Equivalents]
    SELECT [1].[HFM Country], [1].[ENTITY DETAIL], [1].[Product Detail], [1].[Container Detail]
    FROM 1
    GROUP BY [1].[HFM Country], [1].[ENTITY DETAIL], [1].[Product Detail], [1].[Container Detail]
    PIVOT [1].Period;


    The table [1] is a query output which concatenates 2 columns from the Volumes table as below, Volumes table only has 50,000 records.

    SELECT Volumes.[Month Map] & "" & "-" & "" & Year.YearMap AS Period, Volumes.[HFM Country], Volumes.[ENTITY DETAIL], Volumes.[Product Detail], Volumes.[Container Detail], Volumes.[8 oz Case Equivalents]
    FROM Volumes INNER JOIN [Year] ON Volumes.[Year Display]=Year.YearDisplay
    GROUP BY Volumes.[Month Map], Year.YearMap, Volumes.[HFM Country], Volumes.[ENTITY DETAIL], Volumes.[Product Detail], Volumes.[Container Detail], Volumes.[8 oz Case Equivalents];


    Please help me out as to why it takes so long to execute,

    Thanks in advance.

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    how long does the table1 query take - all by itself?

  3. #3
    Meh is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    3
    30 seconds

  4. #4
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    well that's not quick either - is it. but probably ok. lets assume you are not running on minimal RAM...although a test on a more powerful PC is something you can consider.....

    what I would suggest then is to make a query to write the Q1 results into a new temp table.

    next, resource your crosstab so the record source is this new temp table.

    this is an experiment, but it won't take much time - - I am thinking that the xtab pulling from a table should be much quicker; because it is not waiting on the Q1...

    will be interested to what you find....

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access Takes my Query and Alters it!
    By dso808 in forum Queries
    Replies: 2
    Last Post: 10-01-2010, 03:45 PM
  2. Replies: 1
    Last Post: 06-30-2010, 12:47 PM
  3. Cross Tab Query
    By RycherX in forum Queries
    Replies: 1
    Last Post: 04-26-2010, 12:19 PM
  4. Query Design View Takes a Long Time to Open
    By jackthedog in forum Queries
    Replies: 0
    Last Post: 12-22-2009, 03:27 PM
  5. ODBC and Long Query Time
    By pdouglas in forum Access
    Replies: 0
    Last Post: 07-09-2009, 10:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums