Fix DISTINCT ORDER BY error in KDS station-filtered query

MySQL rejects ORDER BY o.SubmittedOn when SELECT DISTINCT has
DATE_FORMAT(o.SubmittedOn) AS SubmittedOn. Use the alias instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-03-02 17:30:44 -08:00
parent 49e3c812c9
commit 576c90fffd

View file

@ -81,7 +81,7 @@
WHERE #whereSQL#
AND i.StationID = ?
AND oli.IsDeleted = b'0'
ORDER BY o.SubmittedOn ASC, o.ID ASC
ORDER BY SubmittedOn ASC, o.ID ASC
", stationParams, { datasource = "payfrit" })>
<cfelse>
<cfset qOrders = queryTimed("