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

displaying error when i use the below query
getaccount = [select id,name,Billingstate,website,phone from Account where LEFT(name,1)=:LEFT(serval,1)];
serval is search input text value.
if the first char is correct i should get the account .
its throwing error when i use above query .
I think there's a couple of issues here:
(1) LEFT is a formula function - I'm pretty sure you can't use it in a SOQL query
(2) You can't carry out any kind of operation on the field that you are comparing to - you have to use the field name only. So even if LEFT was valid, LEFT(name,1) would give an error
If you want to check the first character, I think something like the following should do it: