Merge data from two tables

rinova

Registered User.
Local time
Today, 08:17
Joined
Aug 27, 2012
Messages
74
Hi all,

I need to take the ID#, first, and last name of one table and the ID#, first, and last name of another table and create a query that will display/merge all the ID#'s, first, and last names of both tables. I can provide a sample database if needed.

Thank you,
Rinova
 
First, this sounds like it could be an improperly structured database. How come you have 2 different tables with ID, first and last names? Why aren't they all in the same database?

Second, you will want a UNION query: http://www.tizag.com/sqlTutorial/sqlunion.php
 
First, this sounds like it could be an improperly structured database. How come you have 2 different tables with ID, first and last names? Why aren't they all in the same database?

Second, you will want a UNION query: http://www.tizag.com/sqlTutorial/sqlunion.php

Here is a sample of the database. Hopefully this will answer your question about it being an improperly structured database and why aren't they all in the same database.
 

Attachments

It looks good. I would use a UNION query to get both those tables' data into one query.
 
Thank you. The Union worked great! Can I bother you with another request or should I create a new post?
 
Sorry for not responding sooner guys I was really busy. I was able to figure out what I was going to ask.

It was taking a true termination date Ex. 9/5/2012 and then displaying the last day of the month 9/30/2012 from the true date. I used the following code:
Code:
Termination Date: DateAdd("m",1,[ps_term_date]-Day([ps_term_date])+1)-1
 
Last edited:
Sorry for not responding sooner guys I was really busy. I was able to figure out what I was going to ask.

It was taking a true termination date Ex. 9/5/2012 and then displaying the last day of the month 9/31/2012 from the true date. I used the following code:
Code:
Termination Date: DateAdd("m",1,[ps_term_date]-Day([ps_term_date])+1)-1

Well, considering September has only 30 days in it, coming up with 9/31/2012 is probably not a good thing.

The best way to get the end of the month is:

Termination Date:DateSerial(Year([ps_term_date]), Month([ps_term_date])+1, 0)

The key there is adding one month to the month of the date and then using the day ZERO (0) which is one less than the month we just came up with.
 
Your correct 9/31/2012 is not right, I mistyped the date it should have been 9/30/2012. I corrected it.
 

Users who are viewing this thread

Back
Top Bottom