Results 1 to 2 of 2
  1. #1
    hose3 is offline Novice
    Windows 8 Access 2013 64bit
    Join Date
    Mar 2017
    Posts
    1

    Display Field Data in Columns

    I have a scheduling database that has the following fields and sample data in a table.
    SCHEDULEAIRCREWID SCHEDULEID AIRCREWID
    1 1 1
    2 1 2
    3 2 7
    4 2 10
    5 2 15
    6 3 3
    7 3 6
    8 3 15
    9 4 2
    10 4 7
















    What I am trying to do, is for every SCHEDULEID, I'd like the AIRCREWID to display in columns either in a query/report. So I'd basically like to see the following:
    SCHEDULEID AIRCREWID AIRCREWID AIRCREWID
    1 1 2 (NULL)
    2 7 10 15
    3 3 6 15
    4 2 7 (NULL)








    Any help would be appreciated.

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,929
    you need another column to indicate the aircrew position (might be 'captain', 'copilot' etc or 1,2,3) and then you can use a crosstab query.

    Your crosstab heading would then be

    ScheduleID...Captain...Copilot.....

    or

    ScheduleID..Crew1..Crew2,,,Crew3

    you cannot have the headings you want because each column heading has to be different

    You can create a numerical position using a subquery, but seem to recall that crosstabs and subqueries don't mix.

    Alternative, if you don't have too many aircrew, is to use the aircrewid as a column heading and with a crosstab you would end up with something like

    ScheduleID...1..2..3..6..7..10..15
    1.................X..X
    2................................X...X...X
    3.........................X..X...........X
    4.....................X.........X

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

Similar Threads

  1. Replies: 3
    Last Post: 10-28-2015, 12:38 PM
  2. Replies: 4
    Last Post: 08-22-2015, 12:30 PM
  3. Replies: 3
    Last Post: 04-23-2014, 02:44 AM
  4. Replies: 3
    Last Post: 12-13-2013, 10:28 AM
  5. Replies: 1
    Last Post: 03-02-2006, 06:17 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