You need to sign in to do that
Don't have an account?
ekb
Malformed Query
Hello
I am building an interface to salesforce to extract some data. I am trying to query the data that has been modified in the last 2 days. I formulated the query as below, but I am getting a MALFORMED_QUERY error. Initially i enclosed the data in quotes, but i got an explict error not to use quotes, any idea ?
select column1, column2 from sobject_name where lastModifiedDate >=2009-07-27T08:00:00.000
LastModifiedDate >=2009-07-27T08:00:00
^
ERROR at Row:1:Column:123
line 1:123 no viable alternative at character '<EOF>'
There are some built-in helpers for date queries. Check the Query Language doc.
Extract:
Best, Steve.
All Answers
There are some built-in helpers for date queries. Check the Query Language doc.
Extract:
Best, Steve.
Nice suggestion. I found the issue with the original syntax, had to include a Z at the end
select...where lastmodifieddate >= 2009-07-27T08:00:00Z
SELECT Id,FirstName,LastName from Contact WHERE Email="aancsjjsjadjkadha'sdweiunjncjxzncnzjjhdsadsas11@gmail.com"
I Am retriving the result from salesforce then i get the this error
no viable alternative at character '"' in D:\wamp\www
And my $forceBaseClient.php
file this is function.
public function query($query) {
$this->setHeaders("query");
$raw = $this->sforce->query(array (
'queryString' => $query
))->result;
$QueryResult = new QueryResult($raw);
$QueryResult->setSf($this); // Dependency Injection
return $QueryResult;
}
When I Try To retrieve Email for eq. ranjeet's1189@gmail.com Query Fails
Thank you
I have a similar error, but for a different reason. When you specify an email address it needs to be surrounded as a literal (surrounded by single quotes). You cannot have a single quote as part of an email address. Hope that helps.