Results 1 to 2 of 2
  1. #1
    garthish is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2016
    Posts
    1

    why does the SQL for a CrossTab query not include all the columns that show up in the data view?

    when I look at the SQL view the select list doesn't match up with the data returned in the DataSheet view. I see all the columns shown in the SQL view select list...and then a bunch of bonus columns with cryptic names and cryptic data. Why and how is this additional stuff showing up?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If you are getting extra columns you aren't expecting, it means the values you are using for COLUMN HEADERS are more varied than you realize.

    For instance if you had a table like this:

    Code:
    tblTestTable
    ID  Batch  Quantity
    1   Test1   5
    2   Test1   10
    3   Test 1 15
    4   Test 2 4
    you would end up with 3 columns if your BATCH was your column header (Test1, Test 1 and Test 2). Look at the source data in the field you are using for your COLUMN HEADERS (run an aggregate query on that field) and you should match up with the columns being displayed in your crosstab query.

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

Similar Threads

  1. Replies: 4
    Last Post: 03-29-2014, 01:29 AM
  2. Replies: 12
    Last Post: 11-04-2013, 07:08 AM
  3. Replies: 2
    Last Post: 10-14-2013, 04:12 AM
  4. Calculating columns in crosstab query
    By GraemeG in forum Queries
    Replies: 11
    Last Post: 06-05-2011, 06:43 PM
  5. Replies: 1
    Last Post: 01-24-2011, 03:03 PM

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