Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 09-23-2007, 07:57 PM   #1
mhisma
Registered User
 
Join Date: Sep 2007
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
mhisma is on a distinguished road
grouping two tables which have different number of data

Hi All,
I have two tables

Table A

EmpID EmpName
001 Will
002 Jack
003 Emma
004 Greg

Table B
EmpName EmpHobby
Will Sport
Jack Reading

I wanna join the two table by using query so the result will be

EmpID EmpName EmpHobby
001 Will Sport
002 Jack Reading
003 Emma (blank)
004 Greg (blank)

what query should I write

Kindly need your help,i am frustrating with this

mhisma is offline   Reply With Quote
Old 09-23-2007, 08:30 PM   #2
EMP
Registered User
 
Join Date: May 2003
Location: GT
Posts: 574
Thanks: 0
Thanked 5 Times in 3 Posts
EMP is on a distinguished road
In query Design View, double click on the line joining the EmpName fields in the two tables. In the dialog that pops up, select the option that includes all records from Table A. Click OK.


Or write in SQL View,

SELECT [Table A].EmpID, [Table A].EmpName, [Table B].EmpHobby
FROM [Table A] LEFT JOIN [Table B] ON [Table A].EmpName=[Table B].EmpName;

^

Last edited by EMP; 09-23-2007 at 08:37 PM.
EMP is offline   Reply With Quote
Old 09-23-2007, 09:07 PM   #3
mhisma
Registered User
 
Join Date: Sep 2007
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
mhisma is on a distinguished road
yes, it worked very well

thank you so much

mhisma is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Planning wallis1905 Tables 55 04-10-2007 01:03 PM
Help request - VBA to copy data from one set of tables to another gellerche Modules & VBA 4 03-29-2006 12:57 AM
Data type conversion - text to number & number to text. connexion Modules & VBA 2 02-04-2006 10:50 PM
Else If.....claen programming datacontrol Reports 6 09-15-2003 05:54 AM
Help with a data entry form with 2 different tables. TedMurphy Forms 12 04-28-2003 05:14 AM




All times are GMT -8. The time now is 04:47 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World