473,497 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Joins in MS Access

7 New Member
SELECT I.ItemID, I.ItemName, L.PVALUE AS Classification, I.ReorderLevel,
I.Rate
FROM (ItemMaster AS I INNER JOIN CategoryMaster AS C
ON I.CategoryID = C.CategoryID)
LEFT JOIN Poplist AS L ON I.Classification = L.PSHORT
WHERE L.PCODE='ITCLS';


In ItemMaster some entries in Classification column are blank. When I
run this query it lefts the blank records. But I want all the records to be
viewed. What is wrong with this query?
Apr 16 '10 #1
1 930
patjones
931 Recognized Expert Contributor
When you do a LEFT JOIN in SQL, such as

Expand|Select|Wrap|Line Numbers
  1. SELECT tblA.employeeID AS [ID], tblA.employeeName AS [Name], tblB.employeeBirthDate AS [Date Of Birth]
  2. FROM tblA LEFT JOIN tblB ON tblA.employeeID = tblB.employeeID

...the result set will contain all the records from tblA, and only records from tblB where a corresponding entry can be found according to the join condition. In my example, all the employees will be listed in the first two columns, but if a particular employee either a) has no entry in tblB at all OR b) has an entry in tblB, but date of birth is left blank, then the "Date Of Birth" will show up as blank for them.

In your case, it would appear that there are some records in "ItemMaster" that either do not have a corresponding record in "Poplist", or have a corresponding record, but Poplist.PVALUE is blank.

Pat
Apr 16 '10 #2

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

Similar topics

9
2748
by: Ed_No_Spam_Please_Weber | last post by:
Hello All & Thanks in advance for your help! Background: 1) tblT_Documents is the primary parent transaction table that has 10 fields and about 250,000 rows 2) There are 9 child tables with...
4
5742
by: Jason_Schaitel | last post by:
I have an application that segregates data into two different databases. Database A has stored procs that perform joins between tables in database A and database B. I am thinking that I have...
7
31534
by: Steve | last post by:
I have a SQL query I'm invoking via VB6 & ADO 2.8, that requires three "Left Outer Joins" in order to return every transaction for a specific set of criteria. Using three "Left Outer Joins"...
2
2568
by: FrankMoore | last post by:
Hi, I'm new to Access development and I'm running into a situation that I can't find the elegant solution to and I'm hoping someone out there can help. Where I'm at is that I have two tables that...
4
6749
by: adolph | last post by:
I created 2 tables, each with an autonumber primary key. Fields are: ID (autonumber Primary key) Number (single) Color (Text) FName (text)in one table and LName (text)in the other What I'm...
2
1605
by: gkellymail | last post by:
the following query works fine: select link.idx, link.x_table, link.x_id_a, link.x_id_z, a.strandid, b.strandid from link_detail, link, strand A, strand B where link_detail.x_table =...
0
18483
NeoPa
by: NeoPa | last post by:
Introduction Joins, in SQL, are a way of linking Recordsets together. They involve restricting which data is returned in the output Recordset. When no join is specified but two Recordsets are,...
1
1430
by: Kevin Frey | last post by:
I know this is a way-out question, and I'm not confident of a positive answer, but I'd like to know whether it is possible to protect/secure a View so that it can only be used as a TARGET in a join...
9
11906
by: shapper | last post by:
Hello, I am used to SQL but I am starting to use LINQ. How can I create Left, Right and Inner joins in LINQ? How to distinguish the different joins? Here is a great SQL example:...
36
2456
by: TC | last post by:
I've used Access for many years. Several times, I've encountered a bug which I refer to as the "Vanishing Joins" bug. When it happens, joins vanish randomly from queries. More specifically, all...
0
7120
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
6991
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
7196
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...
0
7373
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4897
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1405
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
649
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.