Error while using Where condition with transaction group

Hi guys,
I'm trying to use this Where condition to run my transaction group:
"ECUSerialNumber" = '{[~]ECU Projects/ECU Tracking Program/Input ECU serial number}' ORDER BY "DateTime" DESC


but I keep receiving an error during execution. It happens quite often, about 2 out of 3 I trigger the search. The error is below:

Incorrect syntax near the keyword 'ORDER'. Incorrect syntax near the keyword 'ORDER'.

Is there a way for me to clear the error, or sort my data without using Order By?

Thanks!

This makes me thing that the tag binding is returning something with a ' in it somewhere.

If you test it without the order by at all, does that still happen every few transactions? Based on the nature of 'syntax near' errors in expressions it typically means you have something that is formatted wrong and when it tries to send to the jbdc and things aren't escaped properly it will throw a fit thinking you have broken queries.

Which without proper escaping you technically will.

1 Like