Question : How to create SQL recordset for this table

We have a table tblTranslate, with following columns:-
TID (ie index), AgentID, WordID, Word

Agent 1 provides the master words as Word, each with different WordID. Other agents translate  these.

I have difficulty creating the recordset that shows all the words registered by Agent 1, and the translations created by another agent, say agent 28. The recordset should show both words that have been translated by agent 28, and those not yet translated. This recordset would be the basis for a form for the agent to enter/update etc.

Grateful for help. Thanks

Answer : How to create SQL recordset for this table

You have either restrict the joined contents by (A2.WebAgentID = 28)
or you have to allow NULLs in WHERE:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
SELECT     A1.Word, A1.WebAgentID, A2.Word AS AgentWord, A2.WebAgentID AS Agent 
 FROM         dbo.tblTranslateNewCopy A1 
 LEFT OUTER JOIN dbo.tblTranslateNewCopy A2 ON A1.WordID = A2.WordID AND A2.WebAgentID = 28
WHERE     A1.WebAgentID = 1

--------
SELECT     A1.Word, A1.WebAgentID, A2.Word AS AgentWord, A2.WebAgentID AS Agent 
FROM         dbo.tblTranslateNewCopy A1 LEFT OUTER JOIN 
                      dbo.tblTranslateNewCopy A2 ON A1.WordID = A2.WordID 
WHERE     (A1.WebAgentID = 1) AND (A2.WebAgentID = 28 OR A2.WebAgentID IS NULL)
Random Solutions  
 
programming4us programming4us