title: SQL VarChar to Date
body: <p>hi
  i am trying to convert a VarChar date field (e.g. 20100320) to a real date field like </p>
  
  <blockquote>
    <p><code>'dd/mm/yyyy' (e.g. 20/03/2010).</code></p>
  </blockquote>
  
  <p>I have tried two ways:
  a) </p>
  
  <pre><code> (SELECT    MIN(CAST(A.DateOfAction AS Date)) AS Expr1
             FROM      ResAdm.Action A
             WHERE    (A.PersonID = P.PersonID)) 
  
       AS 'Period From',
  </code></pre>
  
  <p>b) </p>
  
  <pre><code>(SELECT    MIN(CONVERT(DATE, A.DateOfAction, 103)) AS Expr1
             FROM      ResAdm.Action A
             WHERE    (A.PersonID = P.PersonID)) 
  
       AS 'Period From',
  </code></pre>
  
  <p>both producing the result like </p>
  
  <blockquote>
    <p>yyyy-mm-dd (e.g. 2010-03-20)</p>
  </blockquote>
  
  <p>but i want the result like </p>
  
  <blockquote>
    <p>dd/mm/yyyy (e.g. 20/03/2010)</p>
  </blockquote>
  
  <p>any help will be appreciated.
  thanks.</p>