I have a table to which new records will be added from a spreadsheet in bulk using Access's import function. Sometimes, the new records will be refer to the same person and I would like to merge them.
Please could someone explain to me how to do this?
(I am an Access novice but have some experience with Excel and Excel vba)
The data is structured like this:
Key First Name Last Name Date Attended Email Address Contactable?
1 Joe Bloggs 1/1/2001 j#blogs.com True
2 Joe Bloggs 9/10/2004 j#blogs.com False
Ideally, it would be merged such that:
the email address must be the same
the first and last names must be the same
the most recent 'contactable' field is retained
dates attended are all stored (ie several values in this field for each record).
Thanks for your help in advance!
Related
I'm new with Access, I'M sure this can be done, (in excel it can) just can't figure it out on Access after 1 week of searching the web, please help.
What I'm trying to achieve is transfer the result of a calculated query to another table for statistics purposes.
I have a table called 'Database' which records data on people( Date in, Date out, age, etc).
I have a query called 'New Arrivals' which calculates how many people arrived today. Let assume my answer is 4.
I want to transfer the value '4' to another table called 'Statistics' in the field called New Arrivals. My goal is to be able to lookup my statistics for any given day.
How do I do this?
Regards,
JF
SQL
INSERT INTO target [(field1[, field2[, …]])]
VALUES (value1[, value2[, …]])
Add records to a table by using an append query
https://support.office.com/en-ie/article/add-records-to-a-table-by-using-an-append-query-98a5bd66-2190-4243-9638-8ef649cf3596
I have an Access table "Contacts" that looks like this:
Contact Extension
Bill Mann 7283
Jim Bob 2563
Sue Zan 5963
etc...
I have another table "Departments" that looks like this:
Department Description
0040 Fun station
0110 Happy town
0110C Happy town with clowns
etc...
I have created a form that pulls in data from Contacts as well as Departments to make some assignments:
What I would like to do is automatically populate this form upon opening, with the latest assignments that were made by the form. Then these assignments can be changed and saved at will. To me this seems to mean that the combobox will be assigned a default value from a table that is distinct from the Contacts and Departments tables. The problem I am running into is that I can't seem to find a way to assign those default values and allow all of the possible choices from Contacts and Departments.
I am happy to use a VBA solution if necessary.
It seems you need a third table to save the "Packaging Materials Assignments" and that the form should be bound to that table.
Then you set each of the fields on the form from each of the comboBoxes. Then save the record and your current assignments are saved.
When you open the form, you see the way the assignments were most recently set. Then you can change the assignments if needed.
I might be convenient if you set the form's Property.Cycle = "Current Record". That way there will only ever be one record in the third table. Also after creating your one record, set "Allow Additions" and "Allow Deletions" to be false for the form.
I would have posted some code, however I completely have no idea where to start!
So I want my employees to use my VB application to request holiday (that bit is done). But now I want them to see all the holidays they have requested in a list.
They each have their own account and their username is present on the holiday table in the database.
It must be able to show all holidays they have booked and not just one, preference is in a list form. I'd also like to exclude 1 column from showing.
Is this possible?
I really appreciate your help in advance.
I have a number of CSV files with hundreds of columns and about 50,000 rows (when opened in Excel). The column headers are almost identical however some column headers may vary from one CSV file to the next, as an example below:-
CSV1
Name Surname DOB
John Smith 31/01/1989
CSV2
Name Age Surname Address DOB
Paul 29 Jones 123 Smith St 30/12/1981
CSV3
Name Surname Address Telephone
Mick Jones 123 Paul St 0123456
Is there any way I can merge all of these into one big CSV file, appending the headers so that in the one main CSV, I would have the headers "Name, Surname, DOB, Age, Address, Telephone" for example and then the respective entries from each CSV falling within their respective column heading. The reason I want to do this is to then populate the information into a big MySql / Sql Server DB table and so it appears easier to do it all initially as one big CSV before importing.
Any suggestions?
Import them into three temporary tables and then merge them into one table using joins on name surname and DOB. Otherwise the data will get all mixed up.
Manual method (bear with me, just giving an idea of the algorithm):
Generate a final list of columns that includes all possible headers in all CSV's.
Open each spreadsheet, one at a time. For each spreadsheet:
Click and drag the headers and insert missing columns so they all match your list from #1
Save the file, and repeat back to #2
Combine all the spreadsheets into a single spreadsheet.
Import.
If you are going to automate this, you will take roughly the same steps. You need a way to determine what all columns are possible, then put the CSV's in the right format and combine them, either in spreadsheet/CSV format, or import them as a bunch of temp tables, and INSERT...SELECT to re-arrange the columns where they belong.
What languages/technologies do you have available to you for the automation? .NET? Java? PHP? How often will this process occur, and how automated does it have to be? Is it a daily process, or weekly, or only going to happen once? How many spreadsheets roughly?
First up, this might be the wrong place to ask this question.. So, sincere apologies for that!
I have two MySQL Tables as follows:
First Table: employee_data
id name address phone_no
1 Mark Some Street 647-981-1512
2 Adam Some Street 647-981-1214
3 John Some Street 647-981-1452
Second Table: employee_wages
id employee_id wages start_date
1 3 $15 12 March 2007
2 1 $20 10 Oct 2008
3 2 $18 2 June 2006
I know, both these tables can be combined into one and there is no need to split this data into two tables. But, what i'm working on requires this data to be separate and in two different tables.
Now, previously my company used to handle all this data in Excel sheets and they followed the conventional method of having these two tables combined into one sheet as follows:
Excel Sheets
id name wages start_date
1 Mark $20 10 Oct 2008
2 Adam $18 2 June 2006
3 John $15 12 March 2007
Now, the objective is to Export the data from Excel sheets into MySQL Tables.
As you can notice employee_data.id is linked to employee_wages.employee_id
How can i replace the values in the Excel Sheet 'name' column so that they represent the actual unique ID they're given in the employee_data.id column..
May be i can do it with PHP/MySQL or i can get this done in VB Script.. BUt, I'm not an expert in VB Script..
Any help will be much appreciated..
Thanks!
Save your Excel data as a csv file (In Excel 2007 using Save As)
Check the saved file using a text editor such as Notepad to see what it actually looks like, i.e. what delimiter was used etc.
Start the MySQL Command Prompt (I’m lazy so I usually do this from the MySQL Query Browser – Tools – MySQL Command Line Client to avoid having to enter username and password etc.)
Enter this command:
LOAD DATA LOCAL INFILE ‘C:\\temp\\yourfile.csv’ INTO TABLE database.table FIELDS TERMINATED BY ‘;’ ENCLOSED BY ‘”‘ LINES TERMINATED BY ‘\r\n’ (field1, field2);
[Edit: Make sure to check your single quotes (') and double quotes (") if you copy and paste this code - it seems WordPress is changing them into some similar but different characters]
Done!
use the vlookup function in excel.
import the data into excel
use vlookup to combine what you need
You can query MySQL from Excel, this example uses INSERT: Excel VBA: writing to mysql database
A recordset can be written to Excel with CopyRecordset : http://support.microsoft.com/kb/246335