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

How to use Date filter to query
select Name from Opportunity where CloseDate > 2014-11-08T00:00:00Z
When I used this soql to query in the developer console,I got the following error message:
value of filter criterion for field 'CloseDate' must be of type of date and should not be enclosed in quotes
I am sure the CloseDate is a Date type. how to correct the query soql to make it work.
When I used this soql to query in the developer console,I got the following error message:
value of filter criterion for field 'CloseDate' must be of type of date and should not be enclosed in quotes
I am sure the CloseDate is a Date type. how to correct the query soql to make it work.
You are giving date in Datetime format instead of Date format.
Here is the correct line
select Name from Opportunity where CloseDate > 2014-11-08
If you want to use it your apex code, it should be like this.
date dt = date.parse('12/27/2009');
list<opportunity> opplst = [SELECT Id FROM opportunity WHERE closedate > :dt];
Thanks & Regards,
Sameer Tyagi
http://mirketa.com
All Answers
You are giving date in Datetime format instead of Date format.
Here is the correct line
select Name from Opportunity where CloseDate > 2014-11-08
If you want to use it your apex code, it should be like this.
date dt = date.parse('12/27/2009');
list<opportunity> opplst = [SELECT Id FROM opportunity WHERE closedate > :dt];
Thanks & Regards,
Sameer Tyagi
http://mirketa.com
any one know about send me basic code