function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
LupoLupo 

please, help me making queries...

hello,
 
sorry for my terrible english.
 
I've two questions for you.
 
1st question: I've to make a query on "Account" table.
This is my query:
 
select Name, BillingStreet, BillingCity, BillingPostalCode from Account where Codice_Conto__c = '76113'
 
ok. My query works well.
But now I need to filter data by LastModifiedDate. For example I need to get results where LastModifiedDate is greater than 1 dec 2004.
What is the right sintax to do this?
I tried this sintax:
 
select Name, BillingStreet, BillingCity, BillingPostalCode from Account where Codice_Conto__c = '76113' and LastModifiedDate > 2001-12-01
 
and many others... but it doesn't works...
 
2nd question: Can I delete a record on sforce using queries?
for example, can I use a command like this:
 
delete from Account where Codice_Conto__c = '76113'
 
??
 
Thank you very mutch for any help,
 
Francesco C.
ScottGScottG

Francesco,

Check out http://www.sforce.com/resources/api.jsp

 

It contains answers to all of your questions.

You need single quotes around your date.  Check the API documentation.

SOQL is only used for data retrieval.

You cannot delete using SOQL - you must use the delete method by passing in an ID array that contains the IDs of the objects you want to delete.

 

LupoLupo

you mean something like this?

[...] where LastModifiedDate>'2003-01-01T12:30:30-05:00'

no, I've tried this... it doesn't work... always the same error :

"System.Web.Services.Protocols.SoapException: MALFORMED_QUERY:..."

I've already seen the API documentation but I've not found anything about filtering data by date...

ScottGScottG

Sorry Lupo, you don't need single quotes..

 

select Id from Account where CreatedDate > 2003-10-29T11:30:00Z is the query used from the api doc, and it runs ok for me.

Have you tested the soql in sforce explorer?

LupoLupo

**bleep**!! doesn't work!!

what is the  "sforce explorer"?

ScotScot

Lupo,

The sforce explorer is a sample sforce application which, among other things, allows you to interactively test SOQL statements by entering them into a window and executing them. It gives quick feedback, and allows iterative testing.

You find it at http://sforce.sourceforge.net

Scot