Unable to bring back all results from table with query

K

Karrot_Bex

For a uni assignment we have a designated query that we have to create.

But when I run the query, I get one result returned to me. I should have two
returned to me, as I have two records in the Problem table.

The SQL is:- SELECT Problem.[Problem Number], User.[User ID], User.[User
Name], User.[Job Title], User.Email, User.[Telephone No], Asset.[Asset Code
No], Problem.[Problem Description], Problem.[Current Activity Log],
Problem.[Solution Description]
FROM [User] INNER JOIN ((Asset INNER JOIN Problem ON Asset.[Asset Code No] =
Problem.[Asset Code No]) INNER JOIN [Contact Log] ON Problem.[Problem Number]
= [Contact Log].[Problem No]) ON User.[User ID] = [Contact Log].[User ID];

The thing is that when I do a select all from the problem table I get all
the results, but I do not when I use the SQL described above.

Any ideas as to what may be causing this?

Cheers in advance
 
J

Jerry Whittle

You are using inner joins which means that there must be a matching record in
both tables or the record won't be returned.

Try changing the joins from the Problem table to Left or Right joins. If the
tables are small enough, you should be able to see which table doesn't have a
matching record.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top