Hi,
Sorry for a delayed response.
For documentation on the SQLstatement used in MailMerge you could refer
this article. A possible resolution to the issue is to use SQLStament2 (the query is above 255 characters).
Also, if you would like to acheive this using the GUI you could use the sort functions available as described
here.
Please let me know if you have any questions.
Thanks,
Avinash.