OK, thanks everybody for your help; the "DISTINCT" clause was indeed the problem. I don't know why it's there (not my code, originally), but I suppose that when selecting so many different fields, it serves no useful purpose, so I'll just remove it. If that gives undesirable results, I'll add in the memo field later, as suggested in this thread.
>It looks like the DISTINCT clause is the issue:
https://support.microsoft.com/en-us/kb/813361 , search for "error 34" (about half way down). You could use a workaround suggested there, or SET ENGINEBEHAVIOR 70 for this SELECT.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)