title: Query of queries and CAST as date
body: <p>I am using cfspreadsheet to read the values out of an excel sheet and then I do a query of queries to sort the date field because all fields returned by cfspreadsheet are of the "VarChar" type. Here is the code:</p>
  
  <pre><code>&lt;cfspreadsheet action = "read" query = "mySpreadsheet" src = "mp.xls" sheet="1" rows="2-178"&gt; 
  
  &lt;cfquery name="mySpreadsheet2" dbtype="query"&gt;
   select  
  (CAST(date_field as DATE))   as mydate
  
  from mySpreadsheet order by mydate
  
  &lt;/cfquery&gt;
  </code></pre>
  
  <p>In the spreadsheet the dates are in Euro format dd/mm/yy. The problem is the CAST function in the query of queries turns the 'date_field' from varchar to date but the American type of date (month first, day after). </p>
  
  <p>For example the excel date_field column contains this value 01/07/2011 (July first 2011 since it is a Eurodate) but it gets converted to {ts '2011-01-07 00:00:00'} in the query of queries. </p>
  
  <p>Is there a way to use CAST in the query of queries to produce a European style date? To get around this in oracle you would do:  to_date(date_field, 'DD:MM:YY') but I don't know how to tackle this here.</p>