Skip to main content
Participating Frequently
March 26, 2008
Answered

cfquery.columnlist order

  • March 26, 2008
  • 1 reply
  • 1952 views
is there a way to have coldfusion return the results from a query in something other than alphabetical order? (like the order the items were selected perhaps? I have a JSON serializer and it runs through the query alphabetically.... I have the query results autobuilding a table but it always puts the columns alphabetically. Is there an option to return the columns in the order the sql is written
    This topic has been closed for replies.
    Correct answer -__cfSearching__-
    Use the GetMetaData(yourQuery) function to return an array of column information. Then construct the desired column list from the returned array.

    1 reply

    -__cfSearching__-Correct answer
    Inspiring
    March 26, 2008
    Use the GetMetaData(yourQuery) function to return an array of column information. Then construct the desired column list from the returned array.