Ok, here's my original query (hurray for backups!):
Code:
SELECT nominees.nom_id
, nominees.nom_title
, nominees.tracking_no
, nominees.nom_summary
, nominees.nom_firstname & ' ' & nom_lastname AS nominee
, nominees.finalized
, judges.user_id AS judge_id
, judges.user_name AS judge
, users.user_name AS nominator
, users.user_org
, scores.cpi_score
, scores.inno_score
, scores.pc_score
, scores.int_score
, scores.equ_score
, scores.ls_score
, scores.drer_score
, scores.iis_score
, scores.css_score
FROM ( ( ( (
nominees
INNER JOIN users
ON users.user_id = nominees.submit_id
)
LEFT OUTER JOIN judgenom
ON judgenom.nomination_id = nominees.nom_id
)
LEFT OUTER JOIN users AS judges
ON judges.user_id = judgenom.judge_id
)
LEFT OUTER JOIN scores
ON scores.nomination_id = nominees.nom_id
)
WHERE scores.judge_id = judgenom.judge_id
OR scores.judge_id IS NULL
ORDER BY nominees.nom_id, judgenom.judge_id
And here's what the db looks like (the ... means that there are more columns,. but they're not involved in the joins or where clauses):
[nominees]
nom_id (primary key, auto number)
submit_id (user ID of person submitting the nomination)
nom_title
nom_summary
...
[users]
user_id (primary key, auto number)
user_name
user_email
...
[judgenom] (assigns nominations to judges)
jn_id (primary key, auto number)
judge_id (user ID of judge)
nomination_id (nom_id of nomination)
[scores]
score_id (primary key, auto number)
nomination_id (nom_id of nomination that this score is for)
judge_id (user ID of judge who submitted this score)
...
My original problem is that when viewing the summary page (that's generated from the query above), you can see all the judges assigned to each nomination. But as soon as one of those judges submits a score, the other two judges vanish. It's almost like I have the wrong type of join, but Access seems very limited to what I can do (i.e. no full outer joins).
Let me know if I need to provide any more info.
Bookmarks