title: Sorting on the date column properly
body: <p>I have the following query that return my data as the example bellow </p>
  
  <pre><code>Nov 1 2017
  Nov 21 2017
  Oct 29 2017
  Oct 30 2017
  </code></pre>
  
  <p>I would like my data to be return as is</p>
  
  <pre><code>Oct 29 2017
  Oct 30 2017
  Nov 1 2017
  Nov 21 2017
  </code></pre>
  
  <p>I have tried the orderby clause on the date value and I had no luck...</p>
  
  <p>Here is my full query where I would like to incorporate my sort functionality.</p>
  
  <pre><code>SELECT  
      DISTINCT CONVERT(varchar(11),E1_INTEGRATE.DBO.ConvertJulianDateToStd(WLDRQJ)) AS 'Due date', 
      WLDOCO, 
      E1_INTEGRATE.DBO.ConvertJulianDateToStd(PDPDDJ), 
      PDTORG as 'Buyer', 
      PDDOCO, 
      'Supplier' = 
                   (SELECT 
                       ABALPH 
                    FROM ps_prod.proddta.F0101 
                    WHERE PHAN8 = ABAN8
                    ), 
      WLKITL
  
  FROM ps_prod.proddta.F3112 -- Work Order Routing
  
  INNER JOIN
      ps_prod.proddta.F4311 -- Purchase order detail
        ON    
          substring(WLRORN, patindex('%[^0]%',WLRORN), 8) = CAST(PDDOCO as VARCHAR(8)) 
          AND WLRKCO = PDKCOO 
  
  INNER JOIN
      ps_prod.proddta.F4301
       ON
         PDDOCO = PHDOCO
  
  INNER JOIN
      ps_prod.proddta.F57JTDT f1
       ON
        F4311.PDCNID = f1.JDDOCO
        AND f1.JDZZCAT5 = 30
        AND f1.JDZZFN5 = 20
        AND f1.JDZZFLDV = 'Yes'
  
  INNER JOIN
     ps_prod.proddta.F57JTDT f2
      ON
       F4311.PDCNID = f2.JDDOCO
       AND f2.JDZZCAT5 = 30
       AND f2.JDZZFN5 = 70
       AND f2.JDZZFLDV = 'Yes'
  
  WHERE
      DATEDIFF(DAY,GETDATE(),E1_INTEGRATE.DBO.ConvertJulianDateToStd(WLDRQJ) ) &lt; 30
      AND RTRIM(WLRORN) &gt; ' '
      AND E1_INTEGRATE.DBO.ConvertJulianDateToStd(WLDRQJ) &gt; CONVERT(datetime,CONVERT(varchar(10),DATEADD(dd, -1, GETDATE()),101))
      AND PDAEXP = 0  -- Extended Price
      AND PDUOPN &gt; 0  -- Unit open quantity
      AND PDNXTR = '400'
  </code></pre>