Solved

Help with previous question...getting table data into one line...group by

Posted on 2014-12-09
4
141 Views
Last Modified: 2014-12-09
Hi

I originally posted a question that Jeffrey Coachman supplied some code that worked great...thanks Jeff.  

How can I get multiple records displayed in one line

After running some tests, I am now wanting to do some grouping.  For example the returned data is:

W~AP 280 GNC~AP 280 Qu~AS 266 GNC~AUH2 283 ADM~B 465 AGE~BA 278 Qu~BU1 293 ADM~CO 293 ADM~F1 254

I am wanting the AP 280 to be grouped together so it displays like:

W~AP 280 GNC Qu~AS 266 GNC~AUH2 283 ADM etc etc.

This will be the same for any of the same letters after the ~ with the same number.

I hope I have explained this okay....if not please let me know and I shall try to clarify.

Thanks

Ajae
0
Comment
Question by:ajaeclarke
  • 2
4 Comments
 
LVL 34

Assisted Solution

by:Mike Eghtebas
Mike Eghtebas earned 250 total points
ID: 40488406
You need to group by first and then use jeff's solution at:

change:
Set rst = CurrentDb.OpenRecordset("YourTable")

to:
Set rst = CurrentDb.OpenRecordset("Select PDCode, PDData From YourTable Group By PDCode, PDData Order By PDCode, PDData")
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 40488874
test this revised db from previous thread
db5.mdb
0
 
LVL 1

Author Comment

by:ajaeclarke
ID: 40490485
Thanks for the comments....both worked great and I have it working now :-)  You guys are great!

I have another questions about a field that I want displayed in a certain way...should I accept these solutions and start another question?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40490494
post a new question for another problem
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question