function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rama Gaikwad 1Rama Gaikwad 1 

Error In Group by query.

Hi All, 
Can you  help me to solve this error .

THIS IS QUERY :
select  Project__c, count(Id),Project__r.Billable_Hours__c, Project__r.Non_Billable_Hours__c,Project__r.Estimated_Hours__c from Case GROUP BY Project__c,Project__r.Billable_Hours__c, Project__r.Non_Billable_Hours__c,Project__r.Estimated_Hours__c


Error Occured In This Query is : 

MALFORMED_QUERY: 
from Case GROUP BY Project__c,Project__r.Billable_Hours__c, Project__r.Non_Billable_Hours__c
                              ^
ERROR at Row:1:Column:154
field 'Billable_Hours__c' can not be grouped in a query call.


Thank you in advanced  :)

Best Answer chosen by Rama Gaikwad 1
Shivam Yadav 8Shivam Yadav 8
Hi Rama,

You can not group by custom number fields and not the ability to group by formulas is a request on the ideaexchange so you will need to create a workflow rule that copies the number to a text field.
Note that most standard number fields cannot be grouped by as well but a few like account.numberofemployees can be.

Thanks

All Answers

Shivam Yadav 8Shivam Yadav 8
Hi Rama,

You can not group by custom number fields and not the ability to group by formulas is a request on the ideaexchange so you will need to create a workflow rule that copies the number to a text field.
Note that most standard number fields cannot be grouped by as well but a few like account.numberofemployees can be.

Thanks
This was selected as the best answer
Rama Gaikwad 1Rama Gaikwad 1
Hi Shivam , 

Thank you !