Results 1 to 5 of 5
  1. #1
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370

    Question Translating a table

    Hey guys, I'm stumped right now.... I'm trying to translate a table for display reasons.



    My original table is as follows:
    EDIT: for better understanding
    Ok guys, So I only have 1 table, TableA which is below

    ID CourseNumber Outcome
    1 1 a
    2 2 a
    3 2 b
    4 3 c
    5 4 b
    6 1 d



    And I'm trying to translate TableA into a temporary table that will look like this:

    CourseNumber a b c d
    1 X X
    2 X X
    3 X
    4 X

    An "X" represents the existence of that record from TableA... So since I have a record 1a, an "X" is marked in the 'a' column.

    How would I go about producing this table?

    Is there a query that would display the result set in the fashion I would like? Or will I have to make an array of some sort and fill it? I'm stumped!


    Thanks,

    cbende2

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Not sure if this is relevant or helpful/
    My first reaction is a table

    TransTbl

    ID (whatever that signifies)
    Letter

    with records like

    1a
    1d
    2a
    2b
    3c
    4b

    Much like a junction table.

    Good luck.

    EDIT: Jumped in too quickly --- was thinking of storage not display.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,936
    use a crosstab query - that will give you a-d across the top. With regards 1-4 rows they will only appear providing there is at least 1 'x'.

    # would be your row heading, letter your column heading and a X as the value (set to first). Thou I hoppe those aren't your real field names

  4. #4
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Please check my post edit. I'm trying to code this in PHP so I don't think a crosstab is possible. Also, any suggestions do not have to be in PHP. Simple psuedo-code will work.

  5. #5
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370

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

Similar Threads

  1. Translating
    By Thomas1951 in forum Access
    Replies: 1
    Last Post: 06-30-2016, 09:18 AM
  2. Translating rows into columns
    By Simbiose in forum Access
    Replies: 6
    Last Post: 10-23-2015, 09:51 AM
  3. Replies: 2
    Last Post: 08-25-2014, 03:09 PM
  4. Replies: 3
    Last Post: 03-21-2014, 04:28 PM
  5. Translating Windows name into Real Name
    By runthis457 in forum Forms
    Replies: 13
    Last Post: 02-14-2011, 06:20 PM

Tags for this Thread

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