Can anyone tell me what's wrong with the following UNION query? When I try to open it I get "Syntax error in FROM clause."
I note that
I note that
- Each of the three SELECT queries runs (opens) quite happily when run by itself;
- If I remove one of them - any one - from the UNION query it runs happily;
- Grouping two of them in parentheses doesn't help;
- learn.microsoft .com says one can have mulltiple SELECT queries in a UNION query; and
- The embedded blank spaces after every 15 characters in the code below aren't there in the original; they' were inserted by Post.Bytes when I pasted the code, for some reason.
Code:
SELECT qry_LatestWalkD etails.PersonID , qry_LatestWalkD etails.MRIText, qry_LatestWalkD etails.Effectiv eDate FROM qry_LatestWalkD etails UNION SELECT SetupQry_Latest BrdOrCteeDetail s.PersonID, SetupQry_Latest BrdOrCteeDetail s.MRIText, SetupQry_Latest BrdOrCteeDetail s.EffectiveDate FROM SetupQry_Latest BrdOrCteeDetail s UNION SELECT SetupQry_Latest SponsoringMRI.P ersonID, SetupQry_Latest SponsoringMRI.M RIText, SetupQry_Latest SponsoringMRI.E ffectiveDate FROM SetupQry_Latest SponsoringMRI ORDER BY PersonID;
Comment