Solved

MS Access Query Question

Posted on 2008-10-29
1
169 Views
Last Modified: 2013-12-17
I have two ms access tables Clients and CareerCodes.

The CareerCodes table I have a clientkey column which corresponds with the appropriate client key in the clients table.

What i want to do is Select * From Clients and join the CareerName from the careercodes table.

I already started working on a query to do this but there is one problem. Sometimes the careercode in the client table is set to 0. In this case there will be no corresponding record in the careercodes table. My query will not bring back those client records because it expects a match on the join criteria.

I need to join CareerCodes.CareerName on Client.ClientKey = careercodes.ClientKey but when there is not corresponding record in careercodes i still need to list the clients record. I don't really care what shows up in the CarreerCodes.CareerName column because i will know there is no career when i see that the client.careercode = 0.

Could somebody give me an example query where it will bring back all of the clients even when there is not a corrisponding record in the career table. I am looking for a solution that will bring back one record per client regardless if they have a corresponding careercode or not, we can dummy in empty strings in the careername column when there is no corresponding record.

Thanks
0
Comment
Question by:talker2004
1 Comment
 
LVL 16

Accepted Solution

by:
HooKooDooKu earned 500 total points
Comment Utility
Is this as simple as making sure there is a record in the careercodes table with a value of zero to match on the Clients with a setting of zero.  (i.e. rather than having a table with a value that is essentially NULL, how about having the table point to a record that the corresponding record has a value of "Blank Record").
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now