headhunter
Posts: 130
|
Posted: 12/22/2012, 8:23 AM |
|
Hello,
Can someone explain me why CCS does give me strange results on a "group by"?
Explanation:
I have a user table with about 86.000 records. When I build a simple grid and do a group by on the user_id it gives me about 35 records and a CCSNotCounted on the counted records label on top of the grid.
When I run the same query in my sql management studio it is no problem to do that.
Normally I have some joins on the grid, one join with a one to many relationship. I came to this simplification of the query/grid because the group by did not what I expected with the joins, but it seems that even on a simple table without joins it doesn't even work...
the user_id field is auto increment and primary key.
The simple query:
SELECT user_id, first_name, e_mail, last_name
FROM cms_users
GROUP BY user_id
Thanks in advance!
Bart Verstricht
|
|
|
Lucius
Posts: 220
|
Posted: 01/09/2013, 6:39 AM |
|
Hi,
This is connected to how the count method is implemented in the CCS. In queries that use Group by you most likely need to override the CountSQL property of DataSource of your Grid.
Put there your own query, that will count it correctly. Just make sure you will do it on Before Execute Select event of the grid.
|
|
|
|