473,386 Members | 1,798 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,386 software developers and data experts.

Combining Data from 4 Tables

Hi,

I am using MS Access 2003 on a Windows XP platform. I am wondering what the best way is to go about combining data from 4 tables. Here is a sample from all 4 tables, with what I would like my results be in in the table below called "TBL_Compiled". Any help is appreciated, and thanks!

TBL_Start_1:
ID, Resource_Name, Start_Date, End_Date
1111, John Smith, 4/11/2007, <blank>
1112, Susan Doe, 5/25/2007, <blank>

TBL_End_1:
ID, Resource_Name, Start_Date, End_Date
1111, John Smith, <blank>, 06/21/2007
1113, William Henry, <blank>, 09/30/2007

TBL_Start_2:
ID, Resource_Name, Start_Date, End_Date
1113, William Henry, 07/25/2007, <blank>

TBL_End_2:
ID, Resource_Name, Start_Date, End_Date
1112, Susan Doe, <blank>, 10/31/2007

TBL_Compiled:
ID, Resource_Name, Start_Date, End_Date
1111, John Smith, 4/11/2007, 06/21/2007
1112, Susan Doe, 5/25/2007, 10/31/2007
1113, William Henry, 07/25/2007, 09/30/2007
Oct 12 '07 #1
3 1628
nico5038
3,080 Expert 2GB
For this you can use a UNION to get all rows into one set.
Based on the union you can define a GroupBy query to "compact" the Start and End dates into one. The "risk" of the GroupBy will be the possible occurrence of multiple Start and or End dates per ID/Resource_Name and/or typo's in the Resource_Name. This can be handled by taking the Minimum for the Start date and the Maximum for the End date.

Getting the idea and need more support ?

Nic;o)
Oct 12 '07 #2
Wahoo! That worked! Thank you!

For this you can use a UNION to get all rows into one set.
Based on the union you can define a GroupBy query to "compact" the Start and End dates into one. The "risk" of the GroupBy will be the possible occurrence of multiple Start and or End dates per ID/Resource_Name and/or typo's in the Resource_Name. This can be handled by taking the Minimum for the Start date and the Maximum for the End date.

Getting the idea and need more support ?

Nic;o)
Oct 14 '07 #3
nico5038
3,080 Expert 2GB
Well done !

Success with your application !

Nic;o)
Oct 14 '07 #4

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

Similar topics

2
by: Ron Sorrell | last post by:
I have a requirment to take data from a large set of tables where the total number of these tables may change on a regular baisis and output into another table. All the tables willl have the...
2
by: Kenneth Fosse | last post by:
Hi. I'm currently working on a project which involves the creation of a web page which reports selected data to customers from two back-end systems. I use ASP script language on IIS, the server...
8
by: Ilan | last post by:
Hi all I need to add data from two Excel sheets (both on the same workbook) to an existing table in my SQL DB. The problem is that each sheet holds different fields for the same record, though...
4
by: Tony Williams | last post by:
I want to combine two tables into one. I have a table with all the field definitions from two other tables. I now need to update this new table with the data from the other two tables.However both...
1
by: Reidar Jorgensen | last post by:
I have several databases, identical in structure but with different data. Is there an esay way to combine all the data into one big database? There are six tables.
3
by: Odawg | last post by:
Hello All Database (Access) Guru's, I am a novice when it comes to databases and I know enough to get simple information for my needs. With that said, I was given an opportunity for improvement...
2
by: J055 | last post by:
Hi I need to search a number of DataTables within a DataSet (with some relationships) and then display the filtered results in a GridView. The Columns that need to be displayed come from 2 of...
3
by: masonic35and7 | last post by:
I work for a school district, and I have just imported 6 Excel worksheets into Access 2007. Now I have 6 different tables. In each table all the fields are the same. I need the easiest way to...
3
by: Ken Fine | last post by:
This is a question that someone familiar with ASP.NET and ADO.NET DataSets and DataTables should be able to answer fairly easily. The basic question is how I can efficiently match data from one...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.