+ Start a Discussion
Peter KayePeter Kaye 

SOQL with multiple IF conditions ?

I want to create a SOQL query which groups data based on collections of values for a field.   So  if I have a field Type with values A,B,C....K , I want to order the records by a GroupCode where  Group1 - A,D,F  Group2  B,C,K   Group 3   E,J.

I could solve this with a custom field and a workflow to calculate the GroupCode value on create or amend.  But it would be easier to do this in the SOQL statement if this were possible.

Any advice here much appreciated.  Thanks.