+ Start a Discussion
Priya Guleria 7Priya Guleria 7 

Error: Compile Error: expecting right square bracket, found 'ModifyO' at line 11 column 91

List<new_namespace__Account_Histroy__c> result=[select new_namespace__Account_Id__c,Count(Name) Name ,new_namespace__Account_Owner_New__c,new_namespace__Account_Owner_Old__c,
                                        new_namespace__Name_New__c,new_namespace__Name_Old__c,new_namespace__Account_Number_New__c,new_namespace__Account_Number_Old__c,new_namespace__Account_Website_New__c,
                                        new_namespace__Account_Website_Old__c,FORMAT(new_namespace__Modified_By_New__c) ModifyN,FORMAT(new_namespace__Modified_By_Old__c) ModifyO from new_namespace__Account_Histroy__c
                                        group By FORMAT(new_namespace__Modified_By_Old__c) ModifyO
                                        ];
NickDevNickDev
Have you tried removing the last ModifyO? if your grouping by that FORMAT function then you don't need to alias it again:
 
List<new_namespace__Account_Histroy__c> result=[select new_namespace__Account_Id__c,Count(Name) Name ,new_namespace__Account_Owner_New__c,new_namespace__Account_Owner_Old__c,
                                        new_namespace__Name_New__c,new_namespace__Name_Old__c,new_namespace__Account_Number_New__c,new_namespace__Account_Number_Old__c,new_namespace__Account_Website_New__c,
                                        new_namespace__Account_Website_Old__c,FORMAT(new_namespace__Modified_By_New__c) ModifyN,FORMAT(new_namespace__Modified_By_Old__c) ModifyO from new_namespace__Account_Histroy__c
                                        group By FORMAT(new_namespace__Modified_By_Old__c)  ];