You need to sign in to do that
Don't have an account?
shephali
how to use string variable in where clause.
hello friends,
here is my code.this query is not working as variable 's' contains a value say s='31'. when i write 31 in place of 's' in where clause it works.
how to solve it as 's' is a variable not constant.please reply
String s = String.valueof(Code);
TableData=[select Name,Last_Name__c from lead__c where Agent_ID__c='s' ];
here is my code.this query is not working as variable 's' contains a value say s='31'. when i write 31 in place of 's' in where clause it works.
how to solve it as 's' is a variable not constant.please reply
String s = String.valueof(Code);
TableData=[select Name,Last_Name__c from lead__c where Agent_ID__c='s' ];
Please use below code :
String s = String.valueof(Code);
TableData=[select Name,Last_Name__c from lead__c where Agent_ID__c = :s ];
Please let me know if I can help you more.
Thanks,
Vishal
All Answers
Please use below code :
String s = String.valueof(Code);
TableData=[select Name,Last_Name__c from lead__c where Agent_ID__c = :s ];
Please let me know if I can help you more.
Thanks,
Vishal