Queries :: Merging Multiple Tables And Extracting Duplicates To CSV File
Feb 27, 2014
We 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"
View Replies
ADVERTISEMENT
Apr 18, 2005
I'm in the process of creating a database to track campaign contributions, and I'm kind of stuck.
I've created tables for the citizens, the candidates, and the contributions to the candidates. Now I'm trying to populate them with an Excel spreadsheet. The problem is I have no clue on how to split the Excel file so the appropriate parts go into each table.
The spreadsheet contains:
Name, address, etc. - This needs to go into the Citizens table
Names of candidates individuals contributed to - This needs to go into the candidates table.
Dollar amounts and dates of contributions - This needs to go into the contributions table.
Each citizen may have made multiple contributions to multiple candidates.
The easy way would be for everything to be in one table, but that would be a bad database design, right? Here's a shortened version of how my tables are designed:
Citizens: Name, contact info, etc. of citizens
Candidates: Name, party affiliation, etc. of candidates
Contributions: Candidate (fk is pk of Candidate table), Citizen (fk is pk of citizen table), contribution date, and contribution amount.
I appreciate the assistance, as I'm getting really frustrated.
J.C.
View 5 Replies
View Related
Oct 24, 2007
Hi.
Stupid question, but I have Access 97 database with ssn in each record.
I need to create a comma-delimted text file with these ssns.
When I use the export text file with a query that lists each record's ssn, it does not produce comma-delimited file.
How?
Russ
View 5 Replies
View Related
Aug 19, 2004
Can someone help me out with writing the expression to pull out the IDs that are duplicates?
I know it is something like count >1. thanks!
View 1 Replies
View Related
Oct 26, 2007
I have data that splite by month, so january data separated from february data, an so on.
can i display those data on one table by using query?
if yes.how can i do that?
thanks
View 5 Replies
View Related
Apr 24, 2008
I am an access (2003) amateur, willing to generate an excel file or table from the data from many queries. Moreover, some fields in those queries having different names but same data type, should be filled in the same columns in the new excel/table. Should I use Macro/SQL?:(
View 2 Replies
View Related
Aug 3, 2007
I have 5 copies of a database that 5 users enter data into (including Pre, Post and Follow-Up information). These users send me their database quarterly and I am suppose to merge the data into one database from which to run reports, etc.
The problem comes in with the auto-numbering. Each "Pre" table has an ID that is auto-numbered. This auto-number is also stored when a corresponding "Post" (or follow-up form) is entered so that we can be sure the pre-, post- and follow-up are all linked to the same individual. When I merge the data, they are reassigned ID numbers in the Pre (while the Post still has the original Pre ID number) so now I've lost the link as to one individual's pre, post and follow-up form.
I realize now that the database shouldn't have been built this way, but is there any way to work around this. I've even tried exporting all of the rows for each of the 5 users into Excel and then importing them into Access in a new table (just so I could have the ease of running queries) but I seem to be getting errors doing that as well.
Any ideas?
Jen B. :)
View 1 Replies
View Related
Aug 3, 2007
I have 5 copies of a database that 5 users enter data into (including Pre, Post and Follow-Up information). These users send me their database quarterly and I am suppose to merge the data into one database from which to run reports, etc.
The problem comes in with the auto-numbering. Each "Pre" table has an ID that is auto-numbered. This auto-number is also stored when a corresponding "Post" (or follow-up form) is entered so that we can be sure the pre-, post- and follow-up are all linked to the same individual. When I merge the data, they are reassigned ID numbers in the Pre (while the Post still has the original Pre ID number) so now I've lost the link as to one individual's pre, post and follow-up form.
I realize now that the database shouldn't have been built this way, but is there any way to work around this. I've even tried exporting all of the rows for each of the 5 users into Excel and then importing them into Access in a new table (just so I could have the ease of running queries) but I seem to be getting errors doing that as well.
Any ideas?
Jen B.:)
View 2 Replies
View Related
Nov 2, 2004
Hi all, I'm not an Access programmer by trade, but unfortunately got handed a project that nobody else wanted.
I have a small database taking shape which will track the auditing of paperwork/files. Each file has a unique ID associated with it, in this case, an account number. Audits will take place by selecting the job area (department), then the type of file (Line, Loan, Increase). This will be used to sort which type of audit questions are asked.
I have the following tables created:
tblQuestions: ID, Question, Product question applies to, Function question applies to, Comment field, and result field.
tblTeamMember: MemberID, TeamMember, Manager, PrimaryFunction
tblAuditResult: AuditID, MemberID, AccountNumber, Question, Result, Comment, Date of Audit
tblProduct: List of product types (line, loan, increase)
tblFunction: list of job functions
Currently a form is displayed so the manager can select the job function, then the file type. This will display:
frmAuditCreate - this form contains the fields: txtAccount, cmbManager, cmbTeamMember, txtAuditDate
Sub form on frmAuditCreate - frmQuestionSub - this form contains the fields: Question, Comment, Result
The frmQuestionSub is built off a query which uses the function and product values to determine which questions to filter and display.
Now, once the user is done flipping through each question in the sub form and input the data into the comment and result field associated with that question, I need that information along with the information on the frmAuditCreate to be stored in the table tblAuditResult. This is the problem I'm having difficulty with. I can't find a way to copy the question, comment, and result and insert it into the same record as the rest of the data.
Unfortunatlly I can't strip the database down enough to meet the 100k or less attachment limit.
View 8 Replies
View Related
Sep 10, 2012
I've created a access database containing multiple tables, theres one main table that will contain all the data compiled.
I then have other tables that contain some matching data but with an additonal column filled in,
I want to be able to pull the data from these other tables into the main table and compile it including merging some data into a single feild.
Effectively this is what the inputs will be:
Code:
Table 1
Ident Number Solution TRN
T0941A1 SLN019149 EFE0008
T0941B1 SLN019149 EFE0008
T0941C1 SLN019149 EFE0008
Code:
Table 2
Ident Number Solution TRN
T0941A1 SLN019149 EFE0167
T0941B1 SLN019149 EFE0167
T0941C1 SLN019149 EFE0167
Code:
Table 3
Ident Number Solution TRN
T0941A1 SLN019149 EFE0188
T0941B1 SLN019149 EFE0188
T0941C1 SLN019149 EFE0188
Then the main table i want to compile the data like this:
Code:
Table 4
Ident Number Solution TRN
T0941A1 SLN019149 EFE0008,TRN0167,EFE0188
T0941B1 SLN019149 EFE0008,TRN0167,EFE0188
T0941C1 SLN019149 EFE0008,TRN0167,EFE0188
i want it to show as 1 line item and compile the TRN numbers into a single feild per row rather than having duplicates.
View 1 Replies
View Related
May 15, 2015
I have a table which has each claim as a single record. A client wishes us to provide the data in a format that lists the each procedure on its own line. I have attached a highlevel example of what the data currently looks like and what the query results should look like.So I need to create a query that would repeat the Claim Number and place all the Procedure fields into one field.
View 1 Replies
View Related
Jul 30, 2015
I am linking to an SQL database that is designed in such a way that the problem description is recorded in multiple records. See a simplified example below. I want to run a query that will merge the information in the PROBLEM_DESCRIPTION and return only one record for PROB_ID 55678.
PROB_ID ORIGINATOR DATE PROBLEM_DESCRIPTION
55678 Jim 01/01/2015 While cleaning my computer, I noticed
55678 Jim 01/01/2015 the screen was cracked. I called
55678 Jim 01/01/2015 the IT department and they said I had
55678 Jim 01/01/2015 to write a work order. However it
55678 Jim 01/01/2015 was rejected without reason.
View 7 Replies
View Related
Aug 9, 2013
I have a table with few Employee ID re-appearing over and over again for two different job status.
Data Example
EMP ID Job Code Emp Name Country Job Status Time Spent (In Hrs)
222 9250 XYZ ABC Complete 6
222 1059 XYZ ABC InComplete 12
222 5050 XYZ ABC Complete 7
222 1050 XYZ ABC InComplete 9
111 2750 MNM IJK Complete 2
111 2150 MNM IJK InComplete 3
111 6550 MNM IJK Complete 7
111 8250 MNM IJK InComplete 9
I need an output which merges the data based on Emp ID, however, adds the time spent for completed and incompleted job status in 2 rows.
Output Requirement:
EMP ID Emp Name Country Job Status Time Spent (In Hrs)
222 XYZ ABC Complete 13
222 XYZ ABC InComplete 21
111 MNM IJK Complete 9
111 MNM IJK InComplete 12
Which query to use? I use Access 2010.
View 1 Replies
View Related
Nov 15, 2013
I am trying to update an existing table in Access with current information that I have imported into Access from excel into a separate table. I was able to use an unmatching query and append all records that were not already in the original table. But there are records in the update table that match the original table, and there in information in fields within that records have new information.I need to find the records that match in the two tables and update the missing data.I am able to create a query that displays the matching records but when I run it as an update query the information in not entered into the original table.
View 7 Replies
View Related
Dec 23, 2014
I've been playing around with a new database design and ran into a possible 'error' that I would like to avoid.
It's going to be a payroll database to store time codes for hours spent working on specific projects. I have been struggling on how to put this together to fit with what we've been doing for years and I think I hit a few breakthroughs this morning.
However I want to avoid this error of possible duplication of entry.
Simple table set up - primary key is just a running integer; Employee ID; and Week Ending Date.
I can have multiple week ending dates for a specific employee; but I want to avoid having the same employee with the same week ending date. I cannot set up either field as being unique.
Quick run of data that would be in this table:
Code:
1 ABC 11/21/2014
2 ABC 11/27/2014
3 ABC 12/07/2014
4 DEF 11/21/2014
5 DEF 11/27/2014
6 DEF 12/07/2014
7 ABC 11/27/2014
in this example, when the last row is entered I need to get a popup or some warning that this time has already been entered.
View 13 Replies
View Related
Jun 11, 2013
Each month I get the previous months data. In that data, I have a list of names that have duplicates in them. Some of the names have last, first middle. Some have just last, first. I want to combine the like names and leave the unlike names not combined.
I want to combine in this situation
ex. Smith, Peter
Smith, Peter W
I do not want to combine in this situation
ex. Smith, Peter M
Smith, Peter W
My goal is to get the original name in a table with the combined name next to it.
Original NameNew Name
Smith, PeterSmith, Peter
Smith, Peter WSmith, Peter
View 2 Replies
View Related
Oct 19, 2013
I am trying to combine two peculiar tables in Microsoft Access and have been unable to do so even after doing a lot of brainstorming and searching on the internet.
The two tables are spend and export
Spend
+-------------+--------+-------+-------+
| Country | Metal | Month | Spend |
+-------------+--------+-------+-------+
| China | Iron | Jan | 100 |
| China | Iron | Feb | 200 |
| China | Iron | March | 300 |
[code]...
View 2 Replies
View Related
Jun 29, 2014
I have a report with 2 access tables (1 Master table and another a daily feed table)
The Master table keeps a log of all incoming records. (once append it to this table, should not show in future reporting)
The Daily feed information within the last 48 hours. (uploaded from an excel report into access temporary table)
When the daily feed table gets completed, I append the records and updated them into the Master to avoid duplication.
When I upload the daily feed table and I match it against the Master table to find duplicates, how can I delete the duplicates from the Daily Feed table?
This is my code to find duplicates:
SELECT CMPreport.ID, CMPreport.MbrName, tblMaster.ID
FROM CMPreport LEFT JOIN tblMaster ON CMPreport.ID = tblMaster.ID
WHERE (((tblMaster.ID) Is Not Null));
View 9 Replies
View Related
Jul 18, 2013
I'm using Access 2003 and excel 2003.
We currently manually run 5 different queries then copy and paste this data into 5 separate tabs on 1 workbook, I'm trying to automate some of this process if possible.
I am trying to use the 'transferspreadsheet' action within a macro to run a query and post it into a template excel file, using this code:
Trasfer Type Export
Spreadsheet Type Excel 8-10
Table Name (query Name)
FIle Name (FIle location)
Has field names No
Range Blank
----
This does seem to work and puts the data on a new tab on the specified workbook.
However I have a few questions:
1. Can you specify which query gets put onto which tab in excel? The tabs have different fixed names.
2. Can you specify which Cell the data gets pasted into to? As each tab has a set of headers and titles which need to remain.i.e would need to get query 1 to start in cell A4.
3. How would you expand the above out so that it runs all 5 queries, would you just add in multiple transfer spreadsheet actions in the same macro?
View 1 Replies
View Related
Jul 1, 2015
I have over 500 folders that contain XML files in each folder. I need to go through each folder and append the data from the XML files into my database.
View 1 Replies
View Related
Nov 25, 2014
I am building a database for a coworker. For one table, he'd like to extract data from different companies' financial reports, specifically a Schedule RC-B (schedule of securities). The format it comes in is PDF, but there are options to download XBRL, SDF and Taxonomy. My computer doesn't recognize any of these other formats. Plus, I'm guessing each company will have a slightly different format, so I don't know if there'd be an efficient way to set up an automatic import. Any way for importing/extracting data from these files?
View 2 Replies
View Related
Jan 4, 2014
I need to count records based on multiple criteria from two different tables. I have two tables (i.e. "tblTasks" and "tblTaskHistory"). The tables have a one-to-many relationship based on the "TaskID" field. "tblTasks" has a field called "AssignedTo" and "tblTaskHistory" has a field called "TaskStatus". I need to know how many tasks have been "reopened", the "reopened" status is located in the "TaskStatus" field in "tblTaskHistory". I need this count against a unique listing of employees which can be found in the "AssignedTo" field in "tblTasks".
View 4 Replies
View Related
Oct 12, 2006
Ok, this is only a very general question, but I'm hoping somebody here can give me some general advice.
Basically, I have three separate database which I've written for my company. They were all written at different times, hence the fact there are three and not one that does three things. The first is used to raise, edit, delete, and track RMA records for returned merchandise. The second is used to raise, edit, and track Training data for people who have undergone my training course. The third is my main database that contains all of my clients' details, plus a log of all calls taken from them. This is the largest and most complex of the databases and has some fairly advanced relationships setup to enabled hundreds of call logs to be linked to a single record of necessary.
Now all three databases have been written using the same kind of structure. They all use popup modal forms to prevent malicious/accidental damage to the database by the staff who use them. They are all locked down and Access cannot be broken into whilst they are running. they all also have their own primary keys.
All these databases work just fine, but I'm now a little tired of each staff member having three shortcuts on their desktops, depending on which database they need to use. what I'd really like to do is somehow merge all three of these databases into one single database, and alter the switchboard accordingly to allow users to access any of the three parts of it.
The problems - as I see them - are: (a) that my main database uses a lot of relationship links to maintain certain records, whilst the other two use none, and, (b) that each database, having been written separately, has records with their own ID keys and autonumbers.
I did toy with the idea of having some kind of function on my main switchboard that would allow me to close the current database being used and open another, all without closing Access, but I haven't been too successful in my tests...
...so, my question is, does anybody have any bright ideas as to how I can go about merging these three, or, at very least, centralising access to all three?
View 3 Replies
View Related
Apr 4, 2014
We've got a software that is creating a mdb file with one table and 10 columns. Every day we have around 30.000 entries in the table. At the end of the week we have 7 different mdb files and usually we copy/paste them into one single file to do the base research. Everything is fine until the mdb's file size is 2GB. I understand that mdb files start behaving strange with files over 2GB of size. Therefore after a couple of months we have several 2GB mdb files. When doing a history research we have to open each and every file to check and search in that file. That can take a lot of time if you have 20 or more mdb files.
What I am asking is ... if there is a possibility to merge all the 2GB files into one or maybe more so that the research wouldn't take so much time.
View 2 Replies
View Related
Nov 12, 2012
I have a feedback database with 3 tables, one for complaints, compliments and other. They have the standard common fields such as name, address, date received, nature of enquiry, investigating officer etc etc.A person can have more than one record in the complaints table and that same person could also have 1 one more records in the compliments and others table. What I would like to do is to be able to display the data for that same person that appears in the complaints, compliments and others table in a report using a search facility by either name or address. This will therefore display the number of times that this person has made contact together with dates and the reasons.
View 1 Replies
View Related
Jun 19, 2015
SELECT tblLeaveBalance_Cashables1.Facility, tblLeaveBalance_Cashables1.Division, tblLeaveBalance_Cashables1.Position, tblLeaveBalance_Cashables1.Name, tblLeaveBalance_Cashables1.[Class Code], tblLeaveBalance_Cashables1.Class_Title AS Classification, tblLeaveBalance_Cashables1.CBID, tblLeaveBalance_Cashables1.[SS Months], tblLeaveBalance_Cashables1.Age,
[code]....
I need to extract data that where vacation time is >640 or annual leave is >640 and where personal Hol hours are >24 and CBID is M06,S06 and R06.
View 4 Replies
View Related