Results 1 to 5 of 5
  1. #1
    Ddempsii is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    24

    Putting multiple records into one row

    Hello all,

    I have a query running to pull names, dates, and a calculated Test score field. The issue I am having is getting this:
    _________________________


    |Name |Date |Test Score|
    |XXXX |xxxx |85 |
    |XXXX |xxxx |90 |
    |XXXX |xxxx |70 |
    |XXXX |xxxx |85 |

    To look like this:
    ________________________________________
    |Name |Date |Test 1|Test 2|Test 3|Test 4|
    |XXXX |xxxx |85 |90 |70 |85 |

    On my report.

    I have read a lot of different solutions to other people's problems with this. It seems very complex with SQL code. I would follow most of it but they all had their "test score" field already in a table. Mine doesn't populate into a table, it's a long IIf statement saying if question 1 = yes then "x" points. It looks like the best answer is to somehow make a "counter" to mark each different test in each month by the same person. Hoping this makes sense. Please let me know if there are questions.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Yes, this requires a field that assigns sequential counter for each group of records. A query can calculate this 'ranking' but the result is not usable in subsequent queries - review http://allenbrowne.com/ranking.html

    A DCount() expression might be able to generate the counter but domain aggregates can cause slow performance.

    Alternatives:

    1. VBA code that writes records to a 'temp' table

    2. VBA code that concatenates data to a single string - review http://allenbrowne.com/func-concat.html


    The calculated field should work but instead of a long IIf expression, maybe you should use a lookup table of the points for each question. Then include this table in query to make the points data available as a native field, not calculated.
    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.

  3. #3
    Ddempsii is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    24
    Thank you for the suggestions, you helped me last time with an issue thanks again, I'll check these out in a little while and get back to you

  4. #4
    Ddempsii is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    24
    June7 I'm in the weeds here, trying everything and nothing seems to work. Thank you for the help though

  5. #5
    Ddempsii is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    24
    Solved Thank you again

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

Similar Threads

  1. Replies: 5
    Last Post: 09-29-2015, 11:08 AM
  2. Replies: 5
    Last Post: 09-29-2014, 07:43 PM
  3. Replies: 10
    Last Post: 02-01-2014, 12:23 PM
  4. Replies: 1
    Last Post: 08-14-2012, 02:43 PM
  5. Putting deifferent records into one record
    By Purple_Heart in forum Access
    Replies: 1
    Last Post: 08-12-2012, 12:05 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