+ Start a Discussion
Sascha DeinertSascha Deinert 

SOQL Left()

Hi,

I get the following error:

Compile Error: unexpected token: ','
public Integer getNoOfEZR() { Integer NoOfEZR = [SELECT Count() FROM Einzelrisiko__c WHERE Left(Versicherungsscheinnummer__c,7) = 5758199]; return NoOfEZR; }
Where is my mistake?

Thank you,
Sascha

Best Answer chosen by Sascha Deinert
Vinit_KumarVinit_Kumar
Assuming that Versicherungsscheinnummer__c is a Text field.

Change your query from 

Integer NoOfEZR = [SELECT Count() FROM Einzelrisiko__c WHERE Versicherungsscheinnummer__c Like '5758199%']; return NoOfEZR; }

to

Integer NoOfEZR = [SELECT Count() FROM Einzelrisiko__c WHERE Versicherungsscheinnummer__c Like '5758199%']; return NoOfEZR; }

If this helps,please mark it as best answer to help others :)