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
ShresthasShresthas 

SOQL problem with one of the custom object

Hi,

I have a custom object Store with custom field StoreNumber.

The properties of StoreNumber Field are: Text(4) (External ID) (Unique Case Insensitive)

Now,I have a store data with StoreNumber = '0059'

 

Whenever I perform a query like following, it doesn't return me any result

Select s.StoreNumber__c, s.DistrictNumber__c From Store__c s
where s.StoreNumber__c = '0059'

 

 

However, if I perform a query like following, it does return me the values including the value for StoreNumber 0059.

Select s.StoreNumber__c, s.DistrictNumber__c From Store__c s
where s.StoreNumber__c >= '0059'
order by s.StoreNumber__c

 

Why is it not returning me the value with earlier query 'equals' ?

 

ANy help will be greatly appreciated.

 

THanks

Ispita_NavatarIspita_Navatar

Hi Shrest,

From the details which you are providing it seems that the soql query :-

Select s.StoreNumber__c, s.DistrictNumber__c From Store__c swhere s.StoreNumber__c = '0059'

is interpreting  s.StoreNumber__c as a number , try removing the query with:-

Select s.StoreNumber__c, s.DistrictNumber__c From Store__c swhere s.StoreNumber__c = '59'  and check if you are getting any result?

 

Do let me know what result you are getting.


ShresthasShresthas

Hi Ispita,

Thanks for the reply.

 

I tried running the query like asked. It didn't returned me any result.

 

I also tried putting >='59'. This didn't returned any result either.

 

Thanks,

Shrest