I have this LINQ query. The date is stored as a string in the database, but I need to order by it. So I convert it to a DateTime, but it doesn't order.
(from m in dbDataContext.TimeCards
where m.TIMECARDDATE != ""
&& m.TIMECARDDATE != null
orderby Convert.ToDateTime(m.TIMECARDDATE) descending
select Convert.ToDateTime(m.TIMECARDDATE)).Distinct().ToList();
Any idea why it doesn't work? I can't change the database, so I have to deal with the data the way it is. I get the data back ordered like this...
2/27/2009
2/26/2009
2/25/2009
2/28/2009
2/24/2009