title: Format date column then ORDER BY in MSSQL query
body: <p>I am calling an "Invoice Date" field from the database and later in my ColdFusion I format that date as follows:</p>
  
  <pre><code>#DateFormat(SESSION.ClientListInvoice.InvoicedDate,"MM/DD/YYYY")#
  </code></pre>
  
  <p>But I actually need to format that column before I use the ORDER DESC/ASC in my original query. Below is what I am trying to accomplish:</p>
  
  <pre><code>&lt;CFQUERY NAME="Get_ClientInvoice" DATASOURCE="#this.DSN#"&gt;
      SELECT CI.ClientName,CI.InvoicedDate
  FROM ClientInvoices
  WHERE Blah Blah Blah
  ORDER BY FORMAT("mm/dd/yyyy", CI.InvoicedDate) DESC, CI.ClientName ASC
  &lt;/CFQUERY&gt;
  </code></pre>
  
  <p>I am just not sure how to format the date from within the query.</p>