Results 1 to 5 of 5
  1. #1
    stricklanpbs is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    3

    Combining value in multiple rows into new field

    I have a database with CPT codes and Revenue Codes

    CPT Primary Rev Code Alternate
    99212 270
    99212 470
    99212 540

    for an export file I need to combine all of the codes into one field separated by commas;

    CPT Primary rev Code Alternate
    99212 270 470, 540

    I am not good with modules just yet and need some help.

    Ideally, I would like a query that would create a new table that I could create an excel export file.



    Thanking anyone in advance for their help

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    in access, you'll need to loop the dataset in code. do you need them grouped, one comma delimited field per CPT code?? if so, you'll dataset will be opened with this code:

    Code:
    rs = currentdb.openrecordset("select cpt, secondfieldname from table " & _
    "order by cpt")

  3. #3
    stricklanpbs is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    3
    Yes, they will be separated by one comma after each one.

  4. #4
    stricklanpbs is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    3
    And no grouping.

    thank you

  5. #5
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    OK, well good luck with the code writing. If you need assistance with some of the syntax let us know.

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

Similar Threads

  1. Combining multiple tables
    By Duncan in forum Access
    Replies: 1
    Last Post: 03-27-2011, 08:41 AM
  2. Replies: 15
    Last Post: 10-14-2010, 12:22 PM
  3. Inserting multiple rows using a value in a field
    By z1efuller1 in forum Queries
    Replies: 1
    Last Post: 01-06-2010, 11:20 AM
  4. Replies: 5
    Last Post: 12-10-2009, 10:33 PM
  5. Combining columns into rows
    By steeveepee33 in forum Queries
    Replies: 5
    Last Post: 04-30-2009, 09:18 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