I need to make this query run in Access
SELECT tblDocumentParticipant.*, NULL
FROM tblDocumentParticipant, tblEsoOption, tblSsvOption
WHERE (([tblDocumentParticipant.EsoOptionId]=0) AND ([tblDocumentParticipant.SsvOptionId]=0))
UNION
SELECT tblDocumentParticipant.*, tblEsoOption.EsoOptionShortDescription
FROM tblDocumentParticipant INNER JOIN tblEsoOption ON tblDocumentParticipant.EsoOptionId = tblEsoOption.EsoOptionId
WHERE (([tblDocumentParticipant.EsoOptionId]<>0))
UNION SELECT tblDocumentParticipant.*, tblSsvOption.OptionShortDescription
FROM tblDocumentParticipant INNER JOIN tblSsvOption ON tblDocumentParticipant.SsvOptionId = tblSsvOption.SsvOptionId
WHERE (([tblDocumentParticipant.SsvOptionId]<>0))
ORDER BY tblEsoOption.EsoOptionShortDescription, tblDocumentSsvOption.OptionShortDescription, tblDocumentParticipant.DocumentCategory, tblDocumentParticipant.DocumentDescription ;
I have the above Access query. I need to display this OptionShortDescription or SsvShortDescription based on which Id(Eso or Ssv) is non zero. I am getting stuck at the ORDER BY bit. How do i include the description fields in the first query. If i don't have the fields in the first query the order does not work. Any clarfications, let me know. Please this is urgent!!!
If there is any other way of approaching this problem, even better!!!
SELECT tblDocumentParticipant.*, NULL
FROM tblDocumentParticipant, tblEsoOption, tblSsvOption
WHERE (([tblDocumentParticipant.EsoOptionId]=0) AND ([tblDocumentParticipant.SsvOptionId]=0))
UNION
SELECT tblDocumentParticipant.*, tblEsoOption.EsoOptionShortDescription
FROM tblDocumentParticipant INNER JOIN tblEsoOption ON tblDocumentParticipant.EsoOptionId = tblEsoOption.EsoOptionId
WHERE (([tblDocumentParticipant.EsoOptionId]<>0))
UNION SELECT tblDocumentParticipant.*, tblSsvOption.OptionShortDescription
FROM tblDocumentParticipant INNER JOIN tblSsvOption ON tblDocumentParticipant.SsvOptionId = tblSsvOption.SsvOptionId
WHERE (([tblDocumentParticipant.SsvOptionId]<>0))
ORDER BY tblEsoOption.EsoOptionShortDescription, tblDocumentSsvOption.OptionShortDescription, tblDocumentParticipant.DocumentCategory, tblDocumentParticipant.DocumentDescription ;
I have the above Access query. I need to display this OptionShortDescription or SsvShortDescription based on which Id(Eso or Ssv) is non zero. I am getting stuck at the ORDER BY bit. How do i include the description fields in the first query. If i don't have the fields in the first query the order does not work. Any clarfications, let me know. Please this is urgent!!!
If there is any other way of approaching this problem, even better!!!