String s='select id,createddate,stagename from opportunity where stagename=\'Closed Won'/ and createddate=TODAY' but i'm getting error like semicolon missing pl any one help me out how to solve this
you got this error because of you are using the forward slash (/) after single qoutes, you need to use back salash (\) before single quotes to skip the extra single quotes in string. use below statement.
String s ='select id,createddate,stagename from opportunity where stagename=\'Closed Won\' and createddate=TODAY' ;
i hope it helps you. Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others thanks, sfdcmonkey.com
Hi Anji P 9, May be try string StgName = 'Closed Won'; string s='select id,createddate,stagename from opportunity where stagename=:Stgname and createddate=TODAY'
you got this error because of you are using the forward slash (/) after single qoutes, you need to use back salash (\) before single quotes to skip the extra single quotes in string. use below statement.
String s ='select id,createddate,stagename from opportunity where stagename=\'Closed Won\' and createddate=TODAY' ;
i hope it helps you. Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others thanks, sfdcmonkey.com
you got this error because of you are using the forward slash (/) after single qoutes, you need to use back salash (\) before single quotes to skip the extra single quotes in string. use below statement.
i hope it helps you.
Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others
thanks, sfdcmonkey.com
All Answers
May be try
string StgName = 'Closed Won';
string s='select id,createddate,stagename from opportunity where stagename=:Stgname and createddate=TODAY'
Cheers,
Aparna
you got this error because of you are using the forward slash (/) after single qoutes, you need to use back salash (\) before single quotes to skip the extra single quotes in string. use below statement.
i hope it helps you.
Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others
thanks, sfdcmonkey.com