Results 1 to 6 of 6
  1. #1
    talliaman64 is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2014
    Posts
    10

    Multiple lines in table, need one line in query returned

    I am a relative newb to Access so please excuse this question which I am sure is very simple. To simplify, I have a table that contains the info below.
    Number Cert Name
    123456789 1234 Brian
    123456789 1235 Brian
    123123123 1236 Janell
    123123123 1237 Janell
    456456456 1238 Amy
    123456789 1239 Brian

    What I want returned is the number, name and cert all in one line, like below

    123456789 Brian 1234 1235 1239
    123123123 Janell 1236 1237


    456456456 Amy 1238

    Thank you in advance for your help!!!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    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
    talliaman64 is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2014
    Posts
    10
    I guess I am just not smart enough to figure out the SQL, all my data is in one table, if that matters. here is what I wrote.
    SELECT SSN, CONCATRELATED("CERT","Z2CIGNA","CERT = " & "CERT")
    FROM Z2CIGNA;
    I get a compile error.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Did you put the VBA code in a general code module?

    Do you have a table of unique SSN/Name records? Are these employees? Are [SSN] and [Number] fields both number type?

    The query is built with [Employess table] but the function will pull data from Z2CIGNA table.

    SELECT SSN, [Name], ConcatRelated("CERT", "Z2CIGNA", "[NUMBER] = " & [SSN]) FROM [Employees table];
    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.

  5. #5
    talliaman64 is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2014
    Posts
    10
    Thank you for your help, I copied and pasted the above and now I get a compile error.
    SELECT SSN, [Name], ConcatRelated("CERT", "Z2CIGNA", "[NUMBER] = " & [SSN]) FROM [Employees table];

    Yes, these are employees and all number fields are the same type.
    I do not have any VBA code built, this may be over my head, sorry!

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Compile error where?

    This certainly won't work if you don't have any VBA code. What exactly about Allen Browne's instructions do you not understand?

    Did you build a query object with the SQL statement?

    The [SSN] and [Number] fields are both number data type?
    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. Replies: 3
    Last Post: 11-15-2012, 09:20 PM
  2. Replies: 3
    Last Post: 08-16-2011, 02:20 PM
  3. Replies: 2
    Last Post: 08-05-2011, 01:24 PM
  4. line chart not showing lines
    By ajetrumpet in forum Reports
    Replies: 0
    Last Post: 09-11-2010, 05:55 PM
  5. Replies: 2
    Last Post: 08-17-2010, 10:54 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