This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi all, So many posts from me lately! Sorry about that, no worries I enjoy Lightspeed a lot and realize these are harder corner cases. Still I want to report them. Linq query:
Note that assignmentYears is already a LINQ statement, with a where clause. Exception:
Extra information: What does work, is leaving out the Count on the group, I suspect that the method is simply not implemented as supported for translation to SQL. I think it should add a HAVING statement to the SQL query: SELECT g1.EmployeeId FROM ( SELECT [Assignments].[EmployeeId] FROM [AssignmentYears] [AssignmentYears] INNER JOIN [Assignments] ON [AssignmentYears].[AssignmentId] = [Assignments].[Id] WHERE [AssignmentYears].[Year] IN (2012) GROUP BY [Assignments].[EmployeeId] HAVING COUNT(*) > 0 ) [g1] When I remove the where on the group (employeeAssignments) it will work just fine, although not filtering out empty groups. The SQL query generated is the same as the one above, with the HAVING excluded. Thanks again! Cheers, Dennis PS. I am back to 4.0 release version, instead of nighties! |
|
|
Hi Dennis, Yes, this is not currently supported. We do have a reasonably old backlog item to look at implementing this (it requires associated support in the core querying engine) which I will dust off and have a look at over the next few days or so. Ill post back once I have had a look into this and let you know if we can get this added in.
|
|
|
Just an update to let you know that I have added in support for specifying Having clauses against the Grouping objects on the core querying and also added in some support for translating this within the LINQ provider. This is now available in the nightly builds so let me know how you get on.
|
|