The query i sent to you doesn’t get error in my studio, maybe some ’ and " placement is wrong. Are your variables is defined in UiPath Studio?.
If your answer is yes, i can send you the query from another platform. UiPath Forum changes the quotes and double quotes different.
Regards
Ömer