You need to sign in to do that
Don't have an account?

SOQL Query Help please
Hi:
I have the following query:
SELECT Student__c, Name, MintoPass__c, Term,Subject FROM Courses Where Student__c='XXX'
Which gives me table like this:
Subject Area | MinPass | Term | |
Arts | 1.0 | 1 | |
Arts | 0.5 | 1 | |
English | 0.5 | 2 | |
Math | 0.5 | 1 | |
Science | 0.5 | 2 | |
Social Studies | 0.5 | 2 |
I want to Group Arts together into one Line...
like
Subjectarea MinPass Term
Arts 1.5 1
English .5 1
Is there a way to break this table up into Terms???
I have place the query above into a List<Courses> student...
Thanks
Yeah I saw those try even doing those... but for some reason you can not do GROUP BY on Formula fields or Number fields...
Go figure... Salesforce comes out with something real good and its not even close to possible to do anything unless u have strings...
Like I would love to group by Term and Grade and Subject and rollup or SUm up Credits earned...
But Term, Grade one is a formula field and the other is a number field...
In apex it will not give an error until you spit the result out in VF... it will tell you Term can not be aggregated field...etc...
Yes you need to translate the aggregate result object into a structure for use with Visualforce. This is a known issue, effectively Visualforce needs to support a map accessor syntax and perhaps maps in Apex need an entry member structure a la java.
As for addressing your problem with formulas you could create additional fields with the static value and a workflow field update that copies the formula value to the field that can be grouped.