473,403 Members | 2,183 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,403 software developers and data experts.

Join multiple rows in VB

1
Hi

My name is Bjorn and I have a VB question:

How do I join multiple rows in VB?
Example
I have the data in a format like this:

Expand|Select|Wrap|Line Numbers
  1.     result 1    result 2
  2. 11104    8    
  3. 11104        1
  4. 11105    2    
  5. 11105        4
I would like to have the data like this

Expand|Select|Wrap|Line Numbers
  1.     result 1    result 2
  2. 11104    8    1    
  3. 11105    2    4
I really appriciate any help I can get. I am not well oriented in VB
Thanks
Bjorn
May 2 '07 #1
2 1163
Dököll
2,364 Expert 2GB
Hi

My name is Bjorn and I have a VB question:

How do I join multiple rows in VB?
Example
I have the data in a format like this:

result 1 result 2
11104 8
11104 1
11105 2
11105 4

I would like to have the data like this

result 1 result 2
11104 8 1
11105 2 4

I really appriciate any help I can get. I am not well oriented in VB
Thanks
Bjorn
Hello, Bjorn!

Is this VB 6 you are refering to?

Welcome!

Dököll
May 3 '07 #2
Killer42
8,435 Expert 8TB
Is this VB 6 you are refering to?
And what sort of data are we referring to? Is this something in a text file? An array? An Excel worksheet? A database? A big textbox? Something else?

A general algorithm to handle this might be something along the lines of...
Expand|Select|Wrap|Line Numbers
  1. Read each line
  2.   If the first part is the same as the previous line
  3.     Add the second part to our output line
  4.   Else
  5.     Write out the output line (if any)
  6.     Clear the output line
  7.     Put the current line into the output line
  8.   End If
  9. End of loop
May 3 '07 #3

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

Similar topics

7
by: Dave | last post by:
I have 2 tables, one with names, and another with addresses, joined by their CIVICID number (unique to the ADDRESSINFO table) in Oracle. I need to update a field in the NAMEINFO table for a...
1
by: Mike | last post by:
I am not a sql person and could use some help with a delete...here is what I want: I have the following tables/fields (only including necessary fields) answers result_id results result_id
7
by: steve | last post by:
Can you join two tables across different servers in mySQL, or am I dreaming of Oracle? -- Posted using the http://www.dbforumz.com interface, at author's request Articles individually checked...
3
by: MaxPenguin | last post by:
Hi All, I am banging my head against a brick wall over this problem, so any help in the correct direction would be muchly appreciated! I have 2 SQL (MS SQL) server tables, realated to -...
7
by: stabbert | last post by:
I am attempting to join two tables together on two different unix servers. Here is some relevant info about the tables. TABLE 1 Setup ----------------------- DB2 UDB 7.2 EE
1
by: epigram | last post by:
I'd like to know if there is a best approach, in terms of using the Data Web Controls (i.e. DataGrid, DataList & Repeater), for displaying data that is the result of a query that joins two tables...
7
by: Shanimal | last post by:
I would like to know how to join 2 queries so that the results of these 2 queries show up in the same query: SELECT b.bios_serial_number FROM bios b: SELECT s.system_name FROM system s; ...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
1
by: henryrhenryr | last post by:
Hello! I'm having a bit of trouble with a query. I am trying to paginate a set of results using LIMIT. Each result has a bit of 'basic' data and potentially multiple 'additional' data. I have...
1
by: dharmu131983 | last post by:
Hi, i have 2 tables A & C but i dont have any column common to join them. so i am using a 2nd table say B from my data base and using that i am joing A and C. I want only distinct Values from the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.