473,545 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Merging columns in a table

8 New Member
Hi,

I hope somebody can help me?

I've got a macro that pulls data from an Excel sheet into a table. Everything works okay but I need some way of merging the data in two columns together so that I can use the data in the new column to create a relationship with another table.

For example

Column A Column B
932 12345678

Needs to be

Column C
93212345678

What's the best way of doing this?

Thanks in advance!
Jan 16 '07 #1
4 2040
MMcCarthy
14,534 Recognized Expert Moderator MVP
Hi,

I hope somebody can help me?

I've got a macro that pulls data from an Excel sheet into a table. Everything works okay but I need some way of merging the data in two columns together so that I can use the data in the new column to create a relationship with another table.

For example

Column A Column B
932 12345678

Needs to be

Column C
93212345678

What's the best way of doing this?

Thanks in advance!
Create column C in the table then run an update query

Expand|Select|Wrap|Line Numbers
  1. UPDATE TableName SET [Column C]=[Column A] & [Column B];
This syntax will only work properly if both A and B are text fields.

Mary
Jan 16 '07 #2
NeoPa
32,563 Recognized Expert Moderator MVP
If you have access to the Excel file you could also create a column in there that reflects both columns concatenated.
Let me know if you're interested as the instructions are a little more complicated. Also, if interested, let me know if you will do it as an operator or in VBA (within Excel - only do this if you're reasonably strong in Excel VBA though).
Jan 16 '07 #3
hunter1978
8 New Member
Thanks for you replies guys.

NeoPa - I don't really have access to the Excel file as a new file will be sent to us on a monthly basis from one of our customers.

mmcacarthy - Thanks for your answer. I will give it a go.

Thanks!
Jan 17 '07 #4
NeoPa
32,563 Recognized Expert Moderator MVP
It's nice that you reply to all ideas - even those you don't plan to progress :)
I too felt MMcCarthy's idea the more likely but posting other ideas can sometimes help others who look into the thread later by Googling or such.
Jan 17 '07 #5

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

Similar topics

0
2047
by: Marc Floessel | last post by:
Considering the following example table: Column1 | Column2 | Column3 =========================== NULL |"Value1" | NULL --------------------------- "Value2"| NULL | NULL --------------------------- NULL | NULL |"Value3"
1
4924
by: svdh | last post by:
I have posed a question last saturday and have advanced alot in the meantime. But I am still not there Problem is that I try to merging various fields from various tables in one document in Word 1. Query..I want to keep the fields seperatred. I do not want to sent on field with all accumulated languages from one person to Word. Each...
2
1346
by: Dan Cooper | last post by:
I've got two datasets, each containing a single data table. dstDataSetA.Tables("TableA") dstDataSetB.Tables("TableB") I want to merge them together and delete any non-matching rows. dstDataSetB.Merge(dstDataSetA) doesn't do this. Any ideas or suggestions gratefully received.
1
1661
by: John | last post by:
Hi I have two tables with two columns each. Each table has an id column and a value column. I would like the two tables to be merged so there are three columns id, valuefromtable1 and valuefromtable2 and in such as way that all records from both tables are included but where they don't match the corresponding valuefromtable1 or...
6
1962
by: John | last post by:
Hi I have three tables with a common id with which they can be linked. I need to merge them in a way that the resultant table has all records from three tables. Below is what sort of result I am expecting; Table 1 ID Value1 1 A1
1
1575
by: keveen | last post by:
Can someone tell me how I can import tables from another non-Joomla mysql file into Joomla? Basically it is just from one mySQL database into another. I use phpMyAdmin to import and export the entire file but I don't know how to do queries. I tried exporting the source database and then renaming all the database names to match the ones I want to...
0
1125
by: gimme_this_gimme_that | last post by:
I have a table A with the following columns: A.id A.parent_id A.z_id A.z_parent_id A.schema The values of A.parent_id are currently null and require assigning.
6
2119
by: dannylam4 | last post by:
Hello, I've got a question about merging/concatenating rows. There's a similar topic here: Combining Multiple Rows of one Field into One Result but I didn't know if I should hijack it. Basically, I have a single table in Access that looks like: Name - - - Address - -Email - - - - -Comments John Doe - 11211 - - - j2@g.com - lad John Doe -...
2
1847
by: Neil Chambers | last post by:
I am trying to get my head around dataset merging but despite a little research I could still use a pointer (or ten). Basically I want to perform an outer join operation on a dataset (created from a file operation) and the resulting sql query based on the contents of said dataset. Effectively I would end up with two dataset tables in my...
0
7410
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7923
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7437
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7773
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5984
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5343
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3466
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1025
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.