0
votes

I have the starting AccountId and Ending AccountId and want to fetch all accounts between them using SOAP Partnet API in Dot Net

How can i get this sort of Query to work correctly in SOQL

SELECT Id, Name FROM Account WHERE Id >= 'XXXXXXXXXXXp9ZEAAZ' AND Id <= 'XXXXXXXXXXVOZwyAAH'

It doesn't complain syntax wise but not returning any records

Please help!

1
Hi @user1573610, there is a new stackexchange site specific to Salesforce at salesforce.stackexchange.com. Come join the community over there! :)Mark Pond

1 Answers

0
votes

What is being asked, querying records with ID values in a range, is bad practice. Salesforce ID values are unique to the record but the order of the records shouldn't be determined this way.

A better method would be to use the CreatedDate field of the two boundary records and retrieve the records created between those two dates that way.