AnsweredAssumed Answered

ORDER BY date field using ExecuteSQL

Question asked by JamesPeragine on Jun 12, 2017
Latest reply on Jun 13, 2017 by JamesPeragine

I'm trying to sort primary keys in a list using ExecuteSQL and can't seem to get it to work for a date field.  It works fine if the sort field is a text field in FM.


I know that SQL handles dates differently than Filemaker.  How can I Sort based on a column that's a date field?


ExecuteSQL("SELECT L.\"_pkLeads\"

FROM Leads L

JOIN Merchants M

ON   L.\"_fk_Merchants\" = M.\"_pkMerchants\"

WHERE " & $$sqlFilter & "

ORDER BY ? ";"";""; Leads::Date)