You need to sign in to do that
Don't have an account?

GEOLOCATION on SOQL
Has anyone tried to use their field variable as the center of the distance? PLEASE GET BACK TO ME ASAP
public class kushgeocode { public List<Account> acct {get; set;} //public Integer radius {get; set;} public Decimal myLatitude {get; set;} public Decimal myLongitude{get; set;} public kushgeocode(ApexPages.StandardController controller) { myLatitude = 40.6423077; myLongitude = -74.5680403; acct = [SELECT Name, Geocodes__Latitude__s, Geocodes__longitude__s, BillingStreet, BillingCity, BillingState FROM Account WHERE DISTANCE(Geocodes__c, GEOLOCATION(:myLatitude,:myLongitude), 'mi') < :1000]; /*^^^Change 10 to :xxxxx*/ } }

Basically replace myLatitude and myLongitude with the Location__c value of each individual account