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
Nagarajan CNagarajan C 

i created customobject having one number field my quer select Id from Customer__c where NumberField__c like '%78' but am facing issue

I created  custom object having one number field my query
select Id from Customer__c where NumberField__c like '%78' but am facing the issue String field only possible like query

please anyone help to how to query my number field serach query
Waqar Hussain SFWaqar Hussain SF
select Id from Customer__c where NumberField__c = 78

try above query
Rahul.MishraRahul.Mishra
Hi Nagarajan,

You can not query the number field this way (Like is used with Strings), instead of that use >, < or  = to query the records, below is the example from Account.
Select Id, NumberOfEmployees From Account where NumberOfEmployees >= 8

Mark my answer as best if does help you.

Regards,
Rahul​
Nagarajan CNagarajan C
Thanks Rahul... but I want whatever number start with 78 that records alone 
Nagarajan CNagarajan C
Thanks waquar .but my NumberField__c  values example 
1.789644
2.786477
3.7899393
4.773883

Now I want soql query for whichever number start with 78 that records alone. can you please asset any other conversion for soql.

Java means we can use cast function for a number field.
Waqar Hussain SFWaqar Hussain SF
Create a formula field with return type of text and dump number value to this fomula field. So formula field will hold the value of NumberField__c
Then use below query
 
select Id, NumberField__c  from Customer__c where NumberField_Formula__c like '%78'

 
Nagarajan CNagarajan C
without creating a formula field am not able to achieve this scenario any other way. because I developed lookup component so dynamically they are changed object and field name.so it is not possible to create formula filed for all objects. so number field not possible to search start with is it correct.
Waqar Hussain SFWaqar Hussain SF
Yes, Correct. You will have to create a formula field.