0

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!

user1573610
  • 43
  • 1
  • 7
  • Hi @user1573610, there is a new stackexchange site specific to Salesforce at salesforce.stackexchange.com. Come join the community over there! :) – Mark Pond Nov 20 '13 at 02:15

1 Answers1

0

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.

Mark Pond
  • 113
  • 1
  • 8