Questions tagged [where]
The syntax of the condition expression in a WHERE clause of a SOQL query includes one or more field expressions. You can specify multiple field expressions to a condition expression by using logical operators.
23 questions
0 votes
1 answer
115 views
WHERE condition using dateTime fields not working properly
I am using the Bulk API and when I run a query with a condition WHERE LastModifiedDate > 2024-04-13T00:00:01.000Z it returns around 1000 records. But when I run another query, with WHERE ...
1 vote
1 answer
471 views
Date Field Operator in "where" parameter of @wire LWC
Introduction I am trying to use the "where" parameter provided by the "getRelatedListRecords" of "uiRelatedListApi" within @wire in LWC (reference 1). Specifically, I am ...
0 votes
2 answers
2k views
Error in conversion bigint to varchar SQL
I am getting error SQL Errors occurred while processing retrieved data: Error converting data type varchar to bigint. This my Query and its come from the where clause. Anyone help me to resolve this ...
0 votes
2 answers
431 views
How do I include a COUNT field in SQL with multiple joins?
I have a SQL where I want to pull in all Landlords with more than one Pending Request. The trouble I'm having is not knowing where to place the syntax that will populate the field called '...
0 votes
1 answer
1k views
SOQL WHERE + Integer on Auto Number
I want to retrieve the first x records in my dataset. Logically, I created an Auto Number field, but it's acting like a string. Example: [SELECT id__c FROM Person__c WHERE id__c < '4'] incorrectly ...
1 vote
0 answers
4k views
How to get references of a standard field [closed]
I'm currently working on cleaning up the opportunity object and I'm facing an issue with getting the field references(Apex, Components, Workflow, Process Builder, Email templates, Reports) of complete ...
0 votes
1 answer
1k views
Query based on field equal to field in another query
I have a custom object that has for name a string that matches the BillingPostalCode field from different Accounts objects. I'm querying some accounts, and now I want to limit a query of this custom ...
2 votes
2 answers
1k views
Is there a way to distinguish Long Text Area field or Rich Text Area field from a regular Text Area?
I need to build an interface to allow a user to filter record by the field chosen by the user. I know that I can use Text Area fields in the WHERE Clause but I can't use Long Text Area field or Rich ...
0 votes
1 answer
251 views
Select related object based on priority field
I have two sobjects PriorityCase__c (Person__c(master-detail to Person__c), Priority__c) and Person__c (name). And I want to select Person__c with the highest Priority__c. The highest priority is 1. ...
0 votes
1 answer
295 views
Query apex controller Where into a string
I am not a developer but I am trying to modify this controller that is available in a component I installed via app exchange. For what i understood the code is just converting this query into a string ...
-2 votes
1 answer
1k views
Dynamic SOQL with multiple conditions and undefined amount of variables
I have SOQL like this: [SELECT id FROM CONTACT where lastName =:lastName AND firstName = :firstName] But what to do if there are only lastName variable? What if there are 3 variables or more? I ...
0 votes
1 answer
1k views
How can I make a SOQL which selects Leads filtered by a Converted Account Field not being true?
We have a requirement, after leads are converted, we are sending data to a partner about them. We have a batch process which will periodically look for newly converted leads, send the data to the ...
2 votes
1 answer
10k views
How to filter on CreatedDate using a date range in SOQL?
I'm having problems trying to filter a query by CreatedDate using a date range. The query returns always a wrong set of records. For example, if I want to get all records created until 2020-07-28, it ...
1 vote
0 answers
350 views
Tooling API SOQL Where clause not working for certain fields
I'm working in the developer console using the tooling api to write a query against permission sets. This query works: select Name, Label, Description, ManageableState, NamespacePrefix, Type from ...
0 votes
1 answer
4k views
How to pass set<id> dynamically to soql [duplicate]
I have a dynamic Soql in which I want to pass a set. I get an error: System.QueryException: expecting a colon, found '{' Anonymous window Set<Id> idSet = new Set<Id> (); idSet.add('...