473,372 Members | 950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

Another row value to columns question

48
Hello!

I have an access table filled with 10k records that look like this:

Product Car
601945 Vauxhall Astra
602117 Peugeot 806
602117 Peugeot Expert
602117 Citroen Dispatch
602227 Vauxhall Vectra B
602227 Opel Vectra B

I want it to look like this:
Product Car
601945 Vauxhall Astra
602117 Peugeot 806, Peugeot Expert, Citroen Dispatch
602227 Vauxhall Vectra B, Opel Vectra B

So putting the car models in one comma seperated column for each productcode that is the same. Now I have seen a lot of posts like this but I can't find the solution. Can you help me please?

Thanks! Sander
Nov 18 '15 #1

✓ answered by NeoPa

Hi Sander.

Please let me start by saying that what you propose is a very bad idea indeed. This leads you towards a way of storing data that will be clumsy and very difficult to work with. On the other hand, displaying the data that way, just as one might in MS Excel, may well be very reasonable. For more on this see Database Normalisation and Table Structures.

The link (Listing Items Within GROUP BY Set) will help you to form a query that handles providing data in the format requested. You can use the concept to display or export the data, just as you can to save it and store it. I strongly recommend you avoid doing the latter but I'll leave it with you anyway.

1 778
NeoPa
32,556 Expert Mod 16PB
Hi Sander.

Please let me start by saying that what you propose is a very bad idea indeed. This leads you towards a way of storing data that will be clumsy and very difficult to work with. On the other hand, displaying the data that way, just as one might in MS Excel, may well be very reasonable. For more on this see Database Normalisation and Table Structures.

The link (Listing Items Within GROUP BY Set) will help you to form a query that handles providing data in the format requested. You can use the concept to display or export the data, just as you can to save it and store it. I strongly recommend you avoid doing the latter but I'll leave it with you anyway.
Nov 18 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Robin Munn | last post by:
OK, here's another software design question, one that's been bugging me for a while now. What do y'all think is the best way to handle program-level globals, such as configuration option --...
4
by: cwhite | last post by:
Hi I have another drop list question. I have a table like this: computer dell computer ibm computer hp
74
by: Michael | last post by:
As if we needed another string reversal question. I have a problem with the following code, that I believe should work. int StringReverse(char* psz) { char *p = psz; char *q = psz +...
1
by: Krissy | last post by:
When I create a DTS to export a text file from a table, if I click on the Define Columns button and then Populate from source, then execute, it changes one of the types to not quotable and the size...
11
by: Sweety | last post by:
hello to all members, i have strange question in C. main() { printf("%d",main) ; } here o/p is same for all m/c in TC++ version 3.0 i.e 657. I think this is not garbage.
5
by: WebBuilder451 | last post by:
how can i get the value from a specific column from the selected row of a datagrid in the sub i can get the datakey for item command Me.dgMems.DataKeys(e.Item.ItemIndex) will get me the key...
0
by: BStone | last post by:
Hi Everyone I posted this question in .Net General too, so please forgive me for posting in two boards, but I saw one reply that indicated I might have better luck finding some help here Using...
6
by: Michael | last post by:
How can I get X (or another value) from this string "asdfsadfX", basically i want to get what ever is in between the tags and place them in a variable called $www , can anyone help?
1
by: TeknoShock | last post by:
I am trying to use an if then in javascript to change one value based on what a user inputs for another value. It is not working correctly. Here is the relevant code: ---------------------------...
9
by: beginner | last post by:
Hi, I run into another C API question. What is the simplest way to convert an PyObject into a double? For example, I have PyObject *obj; I know obj is a number, but I do not know the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.