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
trick9trick9 

Data Loader

Hi Friends,

 

 

I am trying to extract records from salesforce through the data loader

All I want to do is to extract contacts fromn a  particular record type and on a particular date.

 

So I am doing

 

select * from contacts where record type = 'some number' and  createddate=2011-9-29.

 

But I get an error  saying that createddate has to of type datetime and should not have quotes enclosed to it.

 

I am supplying date type value and am not enclosing in quotes them why am I getting an error.

 

Please tell me the right way to extract contact records based on date and recordtype.

 

Thanks,

Trick009

 

 

 

 

 

 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
sharrissharris

Yes, The T00:00:00Z represents midnight so the example query I posted returns all contacts created between 2011-09-29 midnight to one second before 2011-09-30 midnight of a specified Record Type.

All Answers

sharrissharris

I got it to work by using this query:

 

SELECT Id, Name, CreatedDate FROM Contact WHERE CreatedDate > 2011-09-29T00:00:00Z AND CreatedDate < 2011-09-30T00:00:00Z AND RecordTypeId = '123456789012345'

 

BTW, I found that you cannot use SELECT *. You have to specify the individual fields.

trick9trick9

Hi Sharris,

 

Thanks a lot for a reply,

I want to clarify something about T00:00:00Z.Could you please expalin me what time it would represent.?Is that midnight?

 

Thanks,

Trick009

sharrissharris

Yes, The T00:00:00Z represents midnight so the example query I posted returns all contacts created between 2011-09-29 midnight to one second before 2011-09-30 midnight of a specified Record Type.

This was selected as the best answer
trick9trick9

Thank You