Results 1 to 2 of 2
  1. #1
    diver_ann is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    1

    Adding Description column to Crosstab Query causes data to disappear

    I've created a crosstab query to display course completions by month for each course ID (Item ID). Then I set up an outer join with my active course list so that all active courses are listed in the query even if there are no completions. I have pulled in additional fields from the Active Course List and everything works fine except the Description field. When, I add that field, it causes some of my data to disappear from the month columns, but the total across all months remains the same.

    Here is a sample of the query results without the Description field:



    Here is a sample of the query results with the Domain ID field replaced by Description:




    Here is the SQL for the query with the Description:
    TRANSFORM CLng(Nz(Sum([Completions by Item with Completion Month].[Number of Completions]),0)) AS [SumOfNumber of Completions]
    SELECT Nz([Scorecard Roll-up LOB Map]![Roll-up LOB],"Unassigned") AS [Scorecard Roll-up LOB], Nz([Monthly Usage Roll-up Map]![Roll-up LOB],"Unassigned") AS [Executive Roll-up LOB], Nz([Active Items]![LOB/Owner],"Unassigned") AS [LOB/Owner], [Active Items].[Item ID], [Active Items].Title, [Active Items].Description, Sum([Completions by Item with Completion Month].[Number of Completions]) AS [Total Of Number of Completions]
    FROM (([Active Items] LEFT JOIN [Completions by Item with Completion Month] ON [Active Items].[Item ID] = [Completions by Item with Completion Month].[Item ID]) LEFT JOIN [Monthly Usage Roll-up Map] ON [Active Items].[LOB/Owner] = [Monthly Usage Roll-up Map].[LOB/Owner]) LEFT JOIN [Scorecard Roll-up LOB Map] ON [Active Items].[LOB/Owner] = [Scorecard Roll-up LOB Map].[LOB/Owner]
    GROUP BY Nz([Scorecard Roll-up LOB Map]![Roll-up LOB],"Unassigned"), Nz([Monthly Usage Roll-up Map]![Roll-up LOB],"Unassigned"), Nz([Active Items]![LOB/Owner],"Unassigned"), [Active Items].[Item ID], [Active Items].Title, [Active Items].Description
    PIVOT Format([Completion Month],"mmm") In ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");


    Does anyone have any insights into why the Description field is messing up the month data? I've had to resort to paste in the column separately after exporting my query to Excel. I'm hoping to find a more elegant permanent solution.

    One note: the content of the Description field is a little wonky, it has special characters. Also, when I was playing with different strategies for setting up the query, the Description field was displaying what looked like Chinese characters. So it's possible the content and not the query structure is responsible for the issue. I which case, any suggestions on how I could reformat or fix the content?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,957
    Odd that it is not every month nor every row.

    Do you want to provide project for analysis?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Crosstab Query - Column differences conflict
    By JoshZulaica in forum Queries
    Replies: 1
    Last Post: 06-23-2011, 01:43 AM
  2. Replies: 20
    Last Post: 02-14-2011, 10:55 AM
  3. Replies: 5
    Last Post: 09-10-2010, 10:07 AM
  4. Replies: 1
    Last Post: 09-05-2010, 11:28 AM
  5. Adding new column to make-table query
    By dtn118 in forum Access
    Replies: 2
    Last Post: 08-03-2008, 06:51 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