Hi Geniuses, I have a Call entity with Start and End properties (of type DateTime?). I want to issue a query to get the average difference between Call.Start and Call.End (i.e. the average length of a call): Query.All<call>().Where(call => call.Start.HasValue && call.End.HasValue).Select(call => call.End.Value.Ticks - call.Start.Value.Ticks).Average(); Unfortunately, DO cannot translate the DateTime.Ticks property. I tried to write my own LINQ translator according to: http://dataobjectsdotnet.googlecode.com ... ationToSQL But I can't seem to figure it out. Could you please provide any advice? Btw, I've already thought about having a persistent property that tracks the difference between Start and End, but the above is a very simplified example. There are many "DateTime difference" calculations I need to make with many types and properties, so I can't add duration properties for each calculation. Thanks! This thread was imported from our support forum. The original discussion may contain more detailed answer. |