Convert.ToDateTime does not work in Where clause

2 posts, 0 answers
  1. Oboro
    Oboro avatar
    10 posts
    Member since:
    Jul 2012

    Posted 08 Oct 2009 Link to this post

    Am trying to run the following linq query:

    var budgetAllocated = from a in _scope.Extent<BudgetDetail>() 
                                  where (Convert.ToDateTime(a.DateAllocated).Month == DateTime.Toady.Month) 
                                  select a; 

    But I keep getting the following error:

    Execution of 'System.Convert:ToDateTime(Object)' on the database server side currently not implemented.

    Please, can any one help? I have been at this all day.



  2. Oboro
    Oboro avatar
    10 posts
    Member since:
    Jul 2012

    Posted 09 Oct 2009 Link to this post

    Found a solution, check "Compare DateTime Objects" thread.
  3. DevCraft banner
Back to Top