HMM okay thats this query. So can you set debug option to email errors and let me know the error you get as it should give you the true full error when it happens again so I can assist by knowing what is failing in that query. What integration is this and url?
Code:
Content visible to verified customers only.