Search code examples
mysqlsalesforcesoqlsimple-salesforce

SOQL and Simple Salesforce query


I have a custom object "DisableUserTask__c" with a field "DisableOn__c." I'm at trying to come up with a query to find any "DisableUserTask__c" task with a "DisableOn__c" field that is passed, but I can't seem to come up with a query.

When I run a query just to get a task, the query "DisableOn__c" field comes back with a return in my timezone with the format: u'2015-07-28T21:00:00.000+0000'

I have tried using:

"select Name, Project__c, Ownerid, Id, DisableOn__c, User__c from PIXDisableUserTask__c WHERE Status__c = 'Pending' AND DisableOn__c < :Datetime.now()"

...but that gives me a malformed query. I'm very new to database queries like this so I'm pretty stuck. Any help would be appreciated! :)


Solution

  • On querying, Salesforce give you the format you are reciving. There is no problem with your query and you can directly use the value you recieved for other operations.