Joshua Posted May 7, 2015 Posted May 7, 2015 Hi, I'm trying to sort my FQL by date and then time ExecuteSQL("SELECT DISTINCT OrderID FROM Tests ORDER BY ODate, OTime DESC"; ""; ""; "") but for some reason it is not working. It gives me the list of OrderID's but not the Descending order that I asked for. Instead, it gives it to me as if I had placed ... ORDER BY ODate ASC. It sorts correctly if I have ODate DESC by itself but... I also need to have it sort it by time. Other information: It's a Specify Calculation Filemaker Pro Advance 13 Windows 8 Thanks in advance
eos Posted May 7, 2015 Posted May 7, 2015 (edited) ExecuteSQL("SELECT DISTINCT OrderID FROM Tests ORDER BY ODate, OTime DESC"; ""; ""; "") Try ExecuteSQL ( " SELECT DISTINCT OrderID FROM Tests ORDER BY ODate DESC, OTime DESC " ; "" ; "") PS: There is one "" too many, i.e. an unused “parameter”, in your function; doesn't do any harm, but is confusing. Edited May 7, 2015 by eos
Joshua Posted May 7, 2015 Author Posted May 7, 2015 eos, Thank you for your reply. I already tried that and the results are the same as if I wrote it as ODate, OTime DESC. It seems to be a bug. Do you have any other suggestion for a work around?
eos Posted May 7, 2015 Posted May 7, 2015 Works for me: ExecuteSQL ( " SELECT theDate, theTime FROM People ORDER BY theDate DESC, theTime DESC " ; Char(9) & Char(9) ; "") returns 2015-05-07 22:37:322015-05-07 22:37:272015-05-07 22:37:252015-05-07 22:37:202015-05-07 22:37:142015-05-07 22:37:082015-05-06 22:37:362015-05-06 22:37:342015-05-06 22:37:302015-05-06 22:37:222015-05-06 22:37:18 Do you need DISTINCT?
Recommended Posts
This topic is 3564 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now