Inflectra Customer Forums: sorting results of a Custom SQL report (Thread) Hello, Im trying to re-sort the results that I get from the SQL query. My query joins Test Cases with Test Steps and Requirements. It seems to be sorting using record IDs by default. However, my Test Steps are out-of-sequence, so Test Step 6 has a higher TEST_STEP_ID than Test Step 5 and these show-up in the report in the same default sequence. I added a new SORTBY column into my SQL hoping that would work but it doesnt Is there another way to custom-sort my results since ORDER BY does not work in ESQL? Thanks! en-US(C) Copyright 2006-2024 Inflectra Corporation.support@inflectra.com/Computers/Software/Project_Management//Computers/Software/Quality_Assurance/KronoDesksupport@inflectra.comhttp://www.inflectra.com/kronodesk/forums/threads120/Support/Forum/spirateam/reports/2104.aspxthreadId=2104Alex Soloviev (alex.soloviev@celerion.com)sorting results of a Custom SQL report Hello, Im trying to re-sort the results that I get from the SQL query. My query joins Test Cases with Test Steps and Requirements. It seems to be sorting using record IDs by default. However, my Test Steps are out-of-sequence, so Test Step 6 has a higher TEST_STEP_ID than Test Step 5 and these show-up in the report in the same default sequence. I added a new SORTBY column into my SQL hoping that would work but it doesnt Is there another way to custom-sort my results since ORDER BY does not work in ESQL? Thanks! Mon, 28 Oct 2019 20:14:57 -04002019-10-29T23:27:19-04:00/Support/Forum/spirateam/reports/2104.aspxmessageId=3675David J (support1@inflectra.com) You can sort using Entity SQL, however you cannot sort by the ALIAS in the SELECT clause, you have You can sort using Entity SQL, however you cannot sort by the ALIAS in the SELECT clause, you have to do it by the actual property names. I.e. if you have: select (TC.TEST_CASE_ID + TS.POSITION) as SORTBY, You cannot use: order by SORTBY You have to use: order by (TC.TEST_CASE_ID + TS.POSITION) Tue, 29 Oct 2019 23:27:19 -04002019-10-29T23:27:19-04:00/Support/Forum/spirateam/reports/2104.aspx#reply3675