J
Jacob Burnetski
I am trying to get what should be a relatively simple query to work,
but have had limited (read: no) success with it in 2 days. The layout
may seem complicated, and perhaps it is for such a neophyte, but I
think it's how it needs to be done.
For the specifics, I have 3 tables: Service Order, Service Data, and
Problem Codes.
In the Service Order table I store the Service Order Number and some
simple data about the call. In the Service Data table I enter the
codes for the problems. I needed to do this in order to work it into
the Service Order form as a sub-form so that I could enter multiple
codes. And finally, the Problem Codes table contains a column of the
codes (also the primary key) and a description of each problem.
I am trying to run a query that will give me the service order number
and the problem description, not code. So far I can only get the
Service Order Number and the Problem Description is blank. The SQL
statement for the query is:
-----------------
SELECT [Service Order].[Service Order Number], [Problem
Codes].[Problem Description]
FROM [Service Order] INNER JOIN ([Problem Codes] RIGHT JOIN [Service
Data] ON [Problem Codes].[Problem Code] = [Service Data].[Problem
Code]) ON [Service Order].[Service Order Number] = [Service
Data].[Service Order Number];
--------------
The Service Data table also contains a column for the Service Order
Number which is related back to the Service Order table as a
One-to-Many. The Problem Code field of the Service Data table is
related to the Problem Code column of the Problem Codes table as a
One-to-Many as well.
Can anyone tell me why I'm coming up empty, please?
but have had limited (read: no) success with it in 2 days. The layout
may seem complicated, and perhaps it is for such a neophyte, but I
think it's how it needs to be done.
For the specifics, I have 3 tables: Service Order, Service Data, and
Problem Codes.
In the Service Order table I store the Service Order Number and some
simple data about the call. In the Service Data table I enter the
codes for the problems. I needed to do this in order to work it into
the Service Order form as a sub-form so that I could enter multiple
codes. And finally, the Problem Codes table contains a column of the
codes (also the primary key) and a description of each problem.
I am trying to run a query that will give me the service order number
and the problem description, not code. So far I can only get the
Service Order Number and the Problem Description is blank. The SQL
statement for the query is:
-----------------
SELECT [Service Order].[Service Order Number], [Problem
Codes].[Problem Description]
FROM [Service Order] INNER JOIN ([Problem Codes] RIGHT JOIN [Service
Data] ON [Problem Codes].[Problem Code] = [Service Data].[Problem
Code]) ON [Service Order].[Service Order Number] = [Service
Data].[Service Order Number];
--------------
The Service Data table also contains a column for the Service Order
Number which is related back to the Service Order table as a
One-to-Many. The Problem Code field of the Service Data table is
related to the Problem Code column of the Problem Codes table as a
One-to-Many as well.
Can anyone tell me why I'm coming up empty, please?