title: Sort Date column in Datatable by year and month through LINQ VB
body: <p>I am trying to sort the createDate column from my datatable. If I have "09/01/2016", "09/03/2017", "09/04/2016" values, it sorts by month like "09/04/2016", "09/03/2017", "09/01/2016" if sorted in Descending order vs  "09/03/2017", "09/04/2016", "09/01/2016"</p>
  
  <p>This is what I have: sortColumn is "createDate"</p>
  
  <pre><code>Dim orderedRows = From row In dt.AsEnumerable()
                        Let [date] = DateTime.ParseExact(row.Field(Of String)(sortColumn), "dd-mm-yyyy", Nothing)
                        Order By [date]row Descending
                        select row 
  </code></pre>
  
  <p>but that doesn't work because if I put the "select" clause, it throws an error. the auto fix in my VB version adds "Select Case" in place of just the "select" and the debugger feels it needs an "end case". Clearly, I'm not looking for any case here!</p>
  
  <p>But without having the select clause, how is my linq query complete?</p>
  
  <p>I also tried converting the column values to date format: "{0:dd/MM/yyyy}" but this is just a conversion from date to datetime which makes it even worse since I don't need the timestamp on these values. </p>
  
  <p>Can someone please tell me what I am missing? </p>
  
  <p>How do I fix this issue?</p>