Use the EntityFunctions.TruncateTime method:
var myQuery = from p in dbContext.Trends
group p by EntityFunctions.TruncateTime(p.UpdateDateTime) into g
select new { k = g.Key, ud = g.Max(p => p.Amount) };
More Related Contents:
- LEFT JOIN in LINQ to entities?
- Group by in LINQ
- Group By Multiple Columns
- Dynamic where clause (OR) in Linq to Entities
- How to create LINQ Expression Tree to select an anonymous type
- ‘Contains()’ workaround using Linq to Entities?
- “A lambda expression with a statement body cannot be converted to an expression tree”
- Bulk-deleting in LINQ to Entities
- Entity framework left join
- Entity Framework/Linq EXpression converting from string to int
- Client side GroupBy is not supported
- LINQ: combining join and group by
- The result of a query cannot be enumerated more than once
- “The LINQ expression node type ‘Invoke’ is not supported in LINQ to Entities” – stumped!
- linq distinct or group by multiple properties
- How do I perform Date Comparison in EF query?
- Linq to Entity Join table with multiple OR conditions
- How to get first record in each group using Linq
- Creating dynamic queries with entity framework
- ‘Date’ is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported
- Group by variable integer range using Linq
- String.Equals() not working as intended
- String.IsNullOrWhiteSpace in LINQ Expression
- Dynamic query with OR conditions in Entity Framework
- Calling a SQL User-defined function in a LINQ query
- Add the where clause dynamically in Entity Framework
- linq to entities vs linq to objects – are they the same?
- The LINQ expression node type ‘ArrayIndex’ is not supported in LINQ to Entities
- How do you construct a LINQ to Entities query to load child objects directly, instead of calling a Reference property or Load()
- Only parameterless constructors and initializers are supported in LINQ to Entities message