In A Query - A Way To Merge 2 Tables Into One?
Nov 21, 2007Hi all. Is there some way to merge 2 tables into one in a query? Is it possible? Thank u.
View RepliesHi all. Is there some way to merge 2 tables into one in a query? Is it possible? Thank u.
View RepliesSo I have two tables,
table1: (company_name, company_code, year_month, rating)
table2: (company_name, company_code, year_month, asset, debt, equity,...)
What I would like to do is to call up all the data in table1, and then call up (asset, debt, equity,...) from table2 where the company_code and year-month are equal. What do you think is the best way to do this? Keep in mind a few things:
1. I'm dealing with hundreds of thousands of data lines
2. I may need to get more data similar to table2 in the future and call it up in the same way
I thought I should create a primary key "company_code-year_month"for both tables, but that method doesn't seem like a good one, and if I were to have another table, will have to create the same primary key for that table as well?
I'm trying to merge 3 tables into 1
Made new table which contains all the fields from the 3 source tables
Exported source table 1 to xls
On importing to destination table I get "an error has occurred. Data not imported"
Can anyone shed light on how I can do this or waht teh problem might be?
Many thanks
Paul
I have a very simple question which is anoying me already for a very long time. I have two tables both with a key field, a common field and a table specic field. Like :
Key,common,spec1
222,AAAA,20000
333,BBBB,0000
444,CCCC,22000
Key,common,spec2
111,EEEE,PRO
222,AAAA,PRV
777,FFFF,PSR
Which I want to merge to one table like this :
Key,common,spec1,spec2
111,EEEE,-----,PRO
222,AAAA,20000,PRV
333,BBBB,10000,---
444,CCCC,22000,---
777,EEEE,----- ,PSR
If I set a relation on the keyfield, where both keys should be equal, the result is :
222,AAAA,20000,PRV
If I set a relation on the keyfield, wiith all records from table 1 and from table 2 where both keys are equal, the result is :
222,AAAA,20000,PRV
333,BBBB,10000,---
444,CCCC,22000,---
If I set a relation on the keyfield, with all records from table 2 and from table 1 where both keys are equal, the result is :
111,EEEE,-----,PRO
222,AAAA,20000,PRV
777,EEEE,----- ,PSR
How do I solve this?
I have database A & database B, which is a copy of the first.
I have made some changes to database B but need to merge one table back into the original database.
Any ideas.
Thanks.
I have mulitple dbs that are exactly the same in design that I need to combine into one db. The problem that I am having is that the primary keys are autonumbers and I get errors when trying to copy and paste the data into the tables. Is there an easy way to combine/merge all the tables? I have attached a sample for review. Password LOCK
View 4 Replies View RelatedHi,
I have two tables as follows:
___________________________
tableA:
projectid capital
1 200
2 200
3 300
4 400
tableB:
projectid capital
1 100
2 200
3 300
____________________________
I want to create tableC that is a merge of tableA over tableB as follows:
projectid capital
1 200
2 200
3 300
4 400
Can someone tell me how I can get this done please?
I have been struggling with query syntax on this for about 2 days now not knowing how to get this done. Thanks for responding.
I have several tables I have brought in from excel spreadsheets. Each one has one common column (lets call it serial number), but then all the rest have a variety of information (one has location info, one has network info, one has asset tracking info, one has sw load info, etc). What I want to do is a) collect all the records from each table into one, b) merge the records with common key field so I don't have multiple records for this one key field and can have just one record with the information from all the different tables in it, c) not lose any records that don't have a sister record in some other database.
Anyone have any idea the best way of attacking this problem is. Common joins cause problems because of records that are not in both tables get left behind. Union and append queries creae many multiple records with the same ser # but only the bits of info they brought in from their original spreadsheet, not the other info from the other speadsheets. I am an Access Newbie and trying to figure out if this is even possible without extensive coding.
Thanks,
CORiverRat
Hi,
I have 2 tables which have the same variables:
1st is called "stockholm"
The other is "gothenburg"
I tried to query them but the query does not add everything, there are always missing records.
Any tips?
Thank you in advance & best regards
noah
I have several tables I have brought in from excel spreadsheets. Each one has one common column (lets call it serial number), but then all the rest have a variety of information (one has location info, one has network info, one has asset tracking info, one has sw load info, etc). What I want to do is a) collect all the records from each table into one, b) merge the records with common key field so I don't have multiple records for this one key field and can have just one record with the information from all the different tables in it, c) not lose any records that don't have a sister record in some other database.
Anyone have any idea the best way of attacking this problem is. Common joins cause problems because of records that are not in both tables get left behind. Union and append queries creae many multiple records with the same ser # but only the bits of info they brought in from their original spreadsheet, not the other info from the other speadsheets. I am an Access Newbie and trying to figure out if this is even possible without extensive coding.
Thanks,
CORiverRat
Hi there, I'm quite new to Access.I have two tables which have very similar Data, but laid out differently. The main similarities are things like FirstName, LastName, Company. What I need to be able to do is merge the two tables together into one super table. I've tried linking FirstName with FirstName and LastName with LastName on both tables, and running a query, so I can check for duplicate names. But all that brings up is a list like this:Steve Smith Steve AbrahamsSteve Smith Steve McDonaldSteve Smith Steve PerrySteve Smith Steve Vere(those columns would be Old FirstName, Old LastName, New FirstName, New LastName)There are fields in the old table that are not in the new, and vice versa. But the core fields are labeled the same. What's the best way to proceed here?Cheers,Hob
View 5 Replies View RelatedI have a database with the following tables:
- data
- datamodifications
- mergeddata
The "data" table is imported from a large excel file (about 5000 rows and 40 columns) and needs to be updated about once a year. The idea is to use the "datamodifications" table to store all modifications and then merge "datamodifications" and "data" into "mergeddata", so when i have to update the "data" table next year i can just remerge it with my modifications. My problem is that i cant merge the two without getting dupliace entries. I have tried with this query but it gives me duplicate entries:
Code:
SELECT col1, col2, col3
FROM data
UNION
SELECT col1, col2, col3
FROM datamodifications
ORDER BY col1;
How can i remove the duplicate entries (or is there a better way than actually writing SQL to do what i want do to?
I'm have a numbers of tables that contain the number of quotes and sales by date. The tables are split by product
So for example: table a/Table b/Table c all contain...
Date/Quotes/Sales
20.02.07/50/20
21.02.07/55/15
I am trying to create a new table joining these 3 tables together by date
Date/Table a:Quotes/Table b:Quotes/Table c:Quotes and so on
I have created a separate date table and have joined all 3 tables to the date table but I end up with a hugh amount of duplicates.
How do I get rid of the Duplicates?
merging seven tables with the same layout, but different information from different groups into one main table.
View 6 Replies View RelatedI am trying to merge data from multiple rows into one row for each unique ID. I can replicate on how to do this on a table, maybe a query or something like that. Attached img shows
View 3 Replies View RelatedI am pretty new to the using of Microsoft Access. Part of my role at work is to mantain a register of contacts (Aprox 2000 records). When moving into my role there was already an Access Database in place that had been designed and created by another member of staff prior to leaving.
The database contains a wealth of information, however this is spread across MULTIPLE tables (23 to be exact)
I am trying to create a word document that is basically a mail merge in order for me to drag the contact information over to print. However all the information I require is not in one table. Word will only extract the data from one source.
I've been having problems merging a spreadsheet with data into an already created table..
The main things in common is the "MC", "First Name", "Last Name".
I'm trying to update dates etc that are on the spreadsheet exported from another database, and update my datebase with those new dates..
I have an Employee Records table with 29k records that I originally imported from an HRIS system. Lets call this table ORIGINAL table.Each week I export a new Employee Records table from the HRIS system as it contains the latest updated information. IE - New hires, terminations, rate changes, etc. Lets call this table NEW table. It likely contains new records as well as we hire 100+ people per week.
In the ORIGINAL table, I have added fields that are not included in the NEW table. I need to update the records / fields in the ORIGINAL table with the NEW table, but need to keep the ADDED fields.Originally my plan was just to overwrite the ORIGINAL table with the NEW table until I added the additional fields to the ORIGINAL table. I thought that I could export the added fields in the ORIGINAL table, import the NEW table, and run and update query based on the EE ID#.
I have 4 tables that store information on guest charges (stayinfo/room rate, fuel charges, bar tab, merch charges) each linked to table carrying guest ID's. Is there a way to combine/merge all the tables into one in such a way that all of the guestID's are in one column, all of the charges are in another column etc? Basically adding one table to the bottom of another.
View 1 Replies View RelatedWe are a non-profit that does blind mailings for our membership drive.
The company who we buy names and addresses from sends us a delimited file that has these fields as the headings
" ID, FULLNAME,COMPANY, ADR1, ADR2, CITY, STATE, ZIP, FIPS"
Once they send out the mailings, people then send in back a remit slip with a contribution that gets scanned through a program that creates a file that gives us these titles
"ALT ID, AMOUNT PAID, RUN DATE, TENDER, FUND, PURPOSE, SOLICITATION, MEMBERSHIP QUESTION, MEMBER TYPE, CONSTITUENT TYPE, SEGMENT". The "ALT ID" and "ID" are the same in both tables.
I need to find a way to merge the tables and combine the fields that have the same ID # , and then have it create a csv file that reads like this (see below) for only the files of the people that responded so that I can import it into our membership software.
"Alt ID","Title","First Name","Middle Name","Last Name","Suffix","Address1","City","State","ZIP","ct y_code","Amount Paid","Run Date","Tender","Fund","Purpose","Solicitation","Me mbership Question","Member Type","Constituent Type","Segment"
I have database for each location. Every location will update some information in the databases and send it back to me. In those location based databases, information will be stored in one table called "consolidate_input". I will store these databases in one specific directory and then I want to accommodate the data of "consolidate_input" into one master database having the same identical table in the database.
View 1 Replies View RelatedIs there a way to merge duplicate/similar Access 2010 records into one record?
I have an Access table with 1,000 duplicate records, although they are similar and not exact duplicates. As you can see below, some records contain information that other records do not. Yet, the primary key is the same for all duplicate records. I want to find a way to merge data from filled cells of duplicate records into empty cells for each duplicate record. I do not want to concatenate the data (i.e. combine last and first name, etc.). I only want to fill empty cells if there is a match for it in a duplicate record. I will delete the newly exact duplicate records later. Short of correcting the records by hand.
Example
Code:
LastName FirstName SSN Address Phone Email
Doe John 123-45-7891 123 Anywhere St. NULL john(at)gmail.com
Doe John 123-45-7891 NULL (123)456-7890 NULL
Desired Result
Code:
LastName FirstName SSN Address Phone Email
Doe John 123-45-7891 123 Anywhere St. (123)456-7890 john(at)gmail.com
Doe John 123-45-7891 123 Anywhere St. (123)456-7890 john(at)gmail.com
Hey guys,
I'm in need of some help again. I have two tables, Table1 and Table2. I have one field in each table that I want to have the same data. I don't want blanks to be merged, but I want all the data to be the same
for example
Table1
---------
1
3
5
Table2
---------
1
2
4
6
I would like both tables to be merged to show
Table1
-------
1
2
3
4
5
6
Table2
------
1
2
3
4
5
6
But I want to just update both tables and not create anything new.
Sorry if this is unclear
Dear all
I need to merge a number of databases of the same type into one database in access. can you please help me with code itself.
thanks.
Ampah
I am making this harder than it has to be i'm sure. I had a previous post of auto-texting a field, well why can't I just take two fields I have, such as the ID field which is an autonumber field and combine that with a type field that I have which is D.
If I could merge this in a query, wouldn't it give me the results as D01, D02, etc?
I couldn't find anything helpful online, one side said do the following.
SELECT receivables2.type+receivables2.ID
FROM receivables2;
Only I get errors.
I also tried this.
SELECT merge(receivables2.type; receivables2.ID);
FROM receivables2;
But it says merge is an invalid expression.
Could someone please help?
Dear Friends,:)
I have 2 tables .. (GroupNo.) & (employee)
The conjunction between them as :
tbl1 tbl2
--------------------------
No. Name
--------------------------
1 John
1 Alian
1 Sali
2 Robert
2 ......
...
..
.
---------------------------
How Can I make a new Query that produce the result as :
1 John,Alian,Sali
2 Robert,.......
3 ......
Kind Regards,