Questions tagged [query]

A query is an inquiry into the database using the SELECT statement. A query is used to extract data from the database in a readable format according to the user's request.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

Analytics SAQL Query Help

I am trying to group by three fields, year, week and type however, I have had to manipulate the original type field to group two of them under the same category. As per the attached image, I would ...
0 votes
3 answers
40 views

how can I find all fields using SFMC Query Studio

I wanna extract data from data extension but I don't know the fields name exactly. so I tried select * and select fields(all) but both occurred error. How can I know all the name of fields in SFMC ...
  • 1
0 votes
1 answer
37 views

USING DATEADD but no data export to target de

SELECT A.ContactKey, A.Name, A.Email, A.Phone FROM customerfield as A INNER JOIN orderfield as B ON (A.ContactKey = B.ContactKey) WHERE PurchaseDate <= DATEADD (DAY,-7, CAST(GETDATE() AS DATE)) ...
-2 votes
1 answer
44 views

Aggregate Queries: Can I return values where GROUP BY size is greater than 1?

If I say SELECT count(id), field_one__c, field_two__c WHERE field_once__c > 1 AND field_two__c < 6 GROUP BY field_one__c, field_two__c could I have it only return groups where the size ...
  • 1
-3 votes
0 answers
15 views

SQL query error-Error saving the Query field.Field 'Id' is a required for the Target Data Extension. Ensure this field is specified in your query text

I am including Contact field Id which is the ContactKey in my Query starting with select c. Id as ContactKey but an getting the following error: Error saving the Query field.Field 'Id' is a required ...
  • 1
0 votes
1 answer
30 views

Embed Managed Aura component inside LWC

Is there a way to embed an Aura Managed component inside an LWC? The reason is that the aura component shows me which image is currently selected, and I can get the "src" by querying the ...
0 votes
1 answer
34 views

Parentheses on Dynamic SOQL Unexpected Token '('

I still dont get to know why this dynamic query executed through Database.query() is throwing Unexpected Token Error on the parenthesis char. My code so far is this: @AuraEnabled public static ...
0 votes
0 answers
34 views

Talend Select Query doesn't work properly

I'm trying to select the last created closed won opportunity for an account, this is my query used in talend: SELECT Id, Name, CreatedDate, AccountId, StageName FROM Opportunity WHERE StageName = '...
1 vote
1 answer
44 views

Do indexed fields guarantee sort optimisation?

I have an Apex Action that queries records of a custom object called Payable__c. This object has a look-up field called InvoiceId__c. The Apex Action needs to sort Payable__c records according to the ...
  • 115
-4 votes
1 answer
50 views

How to add 7 business days from current day in Salesforce Marketing Cloud through Query Activity [closed]

The scenario is to add 7 business days from today (exclude Saturday and Sunday). Example: If Today is monday, add 7 business days and my result should be next week Wednesday. If today is Thursday, add ...
-5 votes
0 answers
23 views

How to extract One year data from salesforce marketing cloud? [duplicate]

I need one year data from marketing cloud
1 vote
0 answers
44 views

Get list of all users of a public group that match criteria A or criteria B or both

I have a public group comprising six users: UserOrGroupId IsActive 001 true 002 false 003 true 004 false 005 false 006 true I would like to retrieve a list containing all active group members ...
0 votes
0 answers
22 views

Internal Server Error Using SOQL DISTANCE

I'm attempting to use a Distance filter in my query to find accounts within a certain area. I've enabled the geocoding on the BillingAddress field on the account, but even the simplest query fails. ...
  • 507
0 votes
1 answer
48 views

Marketing Cloud Query and SSJS Performance

I have to implement a Marketing Cloud Solution that will have millions of records in a single Data Extension (DE). Most DEs will have 20-30 million records with some DEs going over 100 M. I know how ...
  • 133
0 votes
0 answers
19 views

How to make a request and see the rating of an article from Salesforce using knowledge__VoteStat

Please tell me how to write query correctly to get an article rating, I tried this way /query/?q=Select+Id%2c+ArticleNumber%2c+LastModifiedDate%2c+(Select+Channel%2c+NormalizedScore+From+...
1 vote
1 answer
78 views

Can you conditionally build-up a static SOQL query in Apex?

Within Apex, is there a way to build up a static SOQL query using query "parts" or "fragments"? Consider the following silly example: public with sharing class MyController { @...
  • 201
0 votes
1 answer
22 views

how to query External Managed Account Output

I'm referring to this link and i want to find the AccountId of an external Managed account. I'm not sure how to query this. Or is there any way I can implement this to find the Account Id? Please do ...
-4 votes
1 answer
76 views

SOQL Find all Permission Sets with a given Custom Permission [closed]

How to get all permission set has a custom permission.
  • 371
0 votes
1 answer
33 views

Content Document Parent ID Salesforce

I am completely lost on how to populate a ParentID for Content Documents. I would like to find the parent record (custom object record) linked to the Content Document. I have easily sorted it in the ...
0 votes
4 answers
60 views

How to dynamically extend a WHERE clause in apex

I need to query a list of opportunities where AccountId = AccountId AND OwnerId = UserInfo.getUserId, and if that logged-in user has a higher role(manager), they can see their team members' ...
  • 9
-1 votes
1 answer
52 views

Query Error - Timeout

my query had an error "QUERY FAILED - TIMEOUT". The query is: SELECT DISTINCT S.JobID, S.ListID, S.BatchID, S.SubscriberID, I.ActivityName, I.JourneyName, I.JourneyId, I.VersionId, S....
3 votes
1 answer
57 views

Query Plan Optimizer Questions

I have used 2 filters where both are inclusive. However one was indexed and the other was not. Because of the non indexed field, I assumed a full table scan would be used. However, the screenshot ...
  • 121
-1 votes
1 answer
33 views

SOQL query stopped working, why? [duplicate]

I had this query that was working fine, but then I needed to add some more fields and I get the error message: There was an error when retrieving the Salesforce field information for the object or ...
  • 1
0 votes
1 answer
28 views

Nested Query for Attachment

I need to retieve the Manager Parent Task id in Attachment query. Can we query the grantParent Id in the same query , below query is giving me id of employee and manger but I need task id also which ...
-1 votes
1 answer
49 views

Nested Query for LWC [duplicate]

public static List<WrapperToLWC> getList(String namee){ Id cleanId = (Id) namee; List<SObject> membersList = new List<SObject>(); membersList = [SELECT Id, SObject1, Rol, ...
  • 77
0 votes
0 answers
56 views

Apex Query does not bring data

Hello I have an apex method that uses this query that receives an String with the Id. public static List<WrapperToLWC> getList(String namee){ Id cleanId = (Id) namee; List<SObject> ...
  • 77
-2 votes
2 answers
80 views

Get last modified data older than 30 days from Specific Date in SOQL [closed]

I need to get the user data who did not logged to system for last 30 days from a specific Date. Do you know how we can create a query for that? If you have any suggestions pls let me know. Thanks
  • 39
0 votes
2 answers
97 views

sfmc sql query to update a data extension field using using like function in the same data extension

I am working on a slightly complex scenario and need your help figuring out the correct approach. I have data extension contains 3 columns (product family, product code, product description) each ...
-1 votes
1 answer
34 views

I need to run a range of IDs into my query to get the name, Parent, and Primary Address from Accounts

When I enter the following code, I keep getting the error message Bind variables only allowed in Apex code I am unsure how to make it so I can enter multiple IDs and get back the information I am ...
  • 1
0 votes
1 answer
54 views

Help creating a query to pull all email data from MC into a DE

I want to pull my email data from MC into Market Intelligence (Datorama) by subscriber ID and include enterprise attributes. The best way I have found thus far is to create a DE with the needed info ...
0 votes
1 answer
51 views

How can I add a "contains" criteria in a SOQL query?

I am running a simple query that takes First name, Last name, and email from a dataset. At the end of my query, I need to include to only pull the email addresses that contain ".com" I ...
  • 1
0 votes
0 answers
41 views

How to use SalesForce specific objects for soap api in java

We are trying to use Fuel SDK to be able to get the latest updates but Ssome Objects are missed in Java Fuel SDK like below ones: I need to use these classes but I am not able to find it in fuel sdk ...
  • 13
1 vote
1 answer
121 views

EntityDefinition does not support queryMore(), test records

I have an error when query EntityDefinition: does not support queryMore(), use LIMIT to restrict the results to a single batch. Query in for loop so I moved and it works. But i dont understand where ...
  • 31
-1 votes
1 answer
79 views

Creating a Query Activity in Java [closed]

I am new to SalesForce and I am trying to create a query activity that is explained in https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/creating_a_query_activity.html to retrieve ...
  • 13
-1 votes
1 answer
54 views

CreatedDate = LAST_N_MONTHS:3 vs CreatedDate >= LAST_N_MONTHS:3

This might be a silly question... but I'm trying to get the records created within the last 3 months. I have a custom object and I have the following two queries below. I see that the results are very ...
  • 444
0 votes
1 answer
133 views

simple-salesforce: perform a bulk query on a custom object

I have seen examples of how to perform a bulk query on a standard object like this: sf.bulk.Opportunity.query( "SELECT Id, Account.Name, Name, RecordType.Name, Type WHERE Id = 12345") I ...
0 votes
1 answer
61 views

How to perform the following query? [closed]

I am trying to retrieve records using ContentDocument and ContentDocumentLink but the following query isn't working as expected. SELECT id, ContentDocumentId, ContentDocument.CreatedDate, ...
-2 votes
1 answer
43 views

Querying month column of string datatype

I have a month column which has values like shown below month 01 1 02 2 03 3 04 4 4 09 10 12 So, some of the values have leading zeros and some don't. Now in SOQL query, I am using SELECT xxxx WHERE ...
  • 1
2 votes
2 answers
72 views

Why is this SOQL search case-sensitive?

I have a simple SOQL query of the Contact standard object: https://myinstanceurl.sandbox.my.salesforce.com/services/data/v54.0/query?q=SELECT+FirstName,LastName,MiddleName,Suffix+FROM+Contact+WHERE+...
0 votes
1 answer
69 views

How to apply inclusion and exclusion criteria when data extensions are linked by one to many relationships?

I have a contacts DE table like this: Contacts CustomerID CustomerName Country 1 Alfreds Futterkiste Germany 2 Ana Trujillo Emparedados y helados Mexico 3 Antonio Moreno Taquería Mexico 4 Around ...
  • 169
0 votes
0 answers
23 views

Not able to create record in All subscribers via SQL query activity [duplicate]

Greetings of the day! I am trying to create record in All subscribers via SQL query activity: below is my SQL query **select Email as 'Email Address', Email as 'Subscriber Key', [First Name] as 'Full ...
0 votes
3 answers
54 views

How do I retrieve a String from a SOQL query?

How can I retrieve data as a string from a SOQL query? The code I have below gives an error: "System.ListException: List index out of bounds: 0" If a run a check through Query Editor or even ...
0 votes
0 answers
122 views

Retrieve Parent record field values using Query API

I am trying to query Salesforce opportunities from another Salesforce org using the Query API I am setting the following query in the endpoint method request.setEndpoint('callout:'+namedCredential+'/...
  • 1,175
2 votes
3 answers
121 views

SELECT all from 1 of 2 tables, based on the table with the most rows

This is a bit of a weird question, but I will explain the problem first. Every day we import a refreshed set of data in to a table called MARKETABLE_TABLE. Sometimes there is an error with the ...
0 votes
0 answers
49 views

JSForce DISTINCT Equivalent

I'm looking for the equivalent of a DISTINCT SQL clause using JSForce. Here's an example of what I would like to do (with incorrect syntax of course): conn.sobject('Custom_object__c') .find( {'...
0 votes
1 answer
297 views

SQL Query From Send Data View looking for unique SubscriberKey

I'm trying to run a query to load data into a data extension. It basically pulls sends from the last x number of days from the Sent data view table. I'm trying to just have a record populate for a ...
0 votes
1 answer
108 views

Problem with API Query Python

I am trying to create a query with python using a IN clause : def sf_api_call(action, parameters = {}, method = 'get', data = {}, keys = {}): # pylint: disable=dangerous-default-value ""&...
0 votes
1 answer
105 views

Automation (SQL Query) to add Hard Bounces to a suppression list

Is it possible to use the automation to update the actual suppression list? When I create the query, the Suppression list isn't available as an option. I've looked at the answers to similar questions ...
1 vote
1 answer
80 views

Does SOSL work when there is a criteria for filtering the searched object through a lookup?

I have a SOSL query that queries on three different objects. A standard and two custom objects. After implementing the WHERE clause the query on the standard object is the only part that works. When I ...
2 votes
0 answers
35 views

Is it fair to assume that using QueryLocatorIterator can reduce chance of heap size issues with Selectors?

With the Winter'23 release removal of Open Cursor Limits I wonder, is it worth considering allowing returning Database.QueryLocatorIterator instead of List<SObject>? I have made a quick-n-dirty ...

1
2 3 4 5
33