You need to sign in to do that
Don't have an account?
sudhirn@merunetworks.com
SOQL between condition
Hi,
We have a custom object with name Territory_Lookup__c field inside this object are name, zip_start, zip_end
We have values inside this table like
Name Zip_Start Zip_End
APAC 1 10
NAM 11 20
If we pass 2 to soql it must APAC if user pass 12 it must show NAM
I tried below query its not working Please suggest me how to modify the query
SELECT name,zip_start,zip_end FROM territory_lookup__c where Zip_Start__c >= 2 or Zip_End__c <=2
Thanks
Sudhir
We have a custom object with name Territory_Lookup__c field inside this object are name, zip_start, zip_end
We have values inside this table like
Name Zip_Start Zip_End
APAC 1 10
NAM 11 20
If we pass 2 to soql it must APAC if user pass 12 it must show NAM
I tried below query its not working Please suggest me how to modify the query
SELECT name,zip_start,zip_end FROM territory_lookup__c where Zip_Start__c >= 2 or Zip_End__c <=2
Thanks
Sudhir
All Answers
I have similar use case but instead of numbers I have canada zip codes which are combination of alphanumeric characters.
We have values inside this table like
CarId Zip_From Zip_To
1000 N3W 0A0 N4J 9Z9
2000 P0A 0A0 P0G 9Z9
The query should return CarId = 1000 if input zip code = 'N3W 1A1'
SOQL doesn't support between clause, then how can I compare the string format input zipcode is falling in the range or not?