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
2answers
26 views

SFMC Query Error “An error occurred while checking the query syntax. Errors: Error while parsing query. Please check the syntax”

I am creating this SQL query in Automation Studio. This query gives me an error: An error occurred while checking the query syntax. Errors: Error while parsing query. Please check the syntax When ...
1
vote
1answer
39 views

I want to get number of user logged in to salesforce with specific profile

I want to get number of users logged into salesforce in every 30 minutes for specific profile. LoginHistory doesn't provide profilename/Id ,how can I achieve this
0
votes
1answer
22 views

salesforce bulk query 2.0 OR operator

I am trying to use Bulk query 2.0 and trying to submit a job via workbench for the following query, "query" : "select id, name from Account where name like 'Microsoft%' OR name like '...
0
votes
1answer
22 views

what is wrong in this batch? [closed]

global class ALN_Integration_Batch implements Database.Batchable<sObject> { for (ALN_Integration__c recAln : lstCon) { AccountContactRelation acr = new ...
1
vote
0answers
39 views

Can suppression lists be updated from Automation Studio?

Our Marketing Cloud hierarchy consists of 170 child business units and a single parent business unit. Local marketing emails are sent from the 170 child business units. We track opens and clicks in ...
0
votes
0answers
22 views

SQL activity fails in Automation

I have a DE with 5 Primary Key columns. We are trying to insert data into DE by the SQL activity in Automation Studio with UPDATE Data Action. First time the data was loaded correctly, second time ...
-1
votes
2answers
47 views

System.QueryException: Implementation restriction: ContentDocumentLink?

I have been following this to create a lightning component for lighting:file upload. As you can see there's comments on how to avoid the System.QueryException yet I still am getting it? picture of ...
0
votes
2answers
31 views

How to get related records of look up object in a single SOQL query?

I have a custom object for example, Field__c. Field Object has a look up to object called Rule__c and Rule__c has related list of Rule_Set__c Object. I have a SOQL query for fields in Field__c and ...
0
votes
1answer
31 views

Update Data Extension with SQL Marketing Cloud

I have a data extension (Name: Factura_T_Alex) with a single primary key (Name: NrFactura) and an attribute (Name: DataEmitere) which is a DateTime type. I need only the date part to use in a script ...
0
votes
1answer
27 views

How to put in SQL to see only records that in the field do not have specific data in the marketing cloud?

I am facing a problem when trying to filter the leads and contacts that come from CRM to be used in email marketing. The idea is that the filter does not add people who have the field conta.Name equal ...
0
votes
2answers
54 views

Unopened Query confusion

I am trying to query for unopen email subscribers in the last 180 using the _subscribers and _open data views. Due to the open view being limited to showing only opens and not unopens. I am querying ...
0
votes
0answers
14 views

Sending Email To All Contract Members In Picklist Field

Currently in our organization when a contract is reaching a certain date an email is sent out to certain values in a picklist Contract_Team_Member__c field such as Contract Owner and Contract Manager. ...
2
votes
1answer
45 views

Unexpected behaivor: Database.insert(userList, false) is rolling back User insertion

I am attempting to insert two users with the database.insert method. One user that should work, and another that is missing required fields. // Create two users, one of which is missing a required ...
0
votes
1answer
29 views

Unable to Remove Duplicate records in Query Activity [closed]

I'm using the below query to fetch only the unique "emailid" field value but still I'm getting duplicates SELECT Distinct Emailid , EmailName FROM _job a WHERE a.SuppressTracking=0 and a....
0
votes
1answer
27 views

How to do nested query between contact and opportunity?

I want to make query like this: List<Contact> conList = [SELECT id, name FROM Contact WHERE id IN: [SELECT contactId FROM Opportunity WHERE StageName = 'Closed Won']]; ...
0
votes
1answer
31 views

Query Unsubscribes from a specific MID during a specific Period

I know this code is going to be slightly jacked up... but here it goes... I need a list of people who unsubscribed from a specific MID during 10/1/19 through 3/31/20 Select l.SubscriberKey, l....
1
vote
1answer
35 views

How to query records that have not been modified for the past x years

I want to query all the contact records that have not been modified for the past three years. SELECT Id FROM Contact WHERE LastModifiedDate < LAST_N_YEARS:3 But as LAST_N_YEARS starts from ...
0
votes
2answers
39 views

Query performance | stuck if more than 2 joins are in sql query

I'm trying to get Total number of clicks per each URL for Newsletters and joining 3 data views: click, job and sent. The query was successfully executed when I tested with 2 joins on click and job ...
0
votes
2answers
27 views

can not access parent fields on a master detail

I need to an object and modify it's parent if condition are fullfiled but i'm encoutering an wierd behavior: in my SOQL the __r.field doesn't retrieve the fields values: Below my anonymous code: list&...
0
votes
1answer
22 views

Why is query returning 10-digit ID? [duplicate]

This is returned as the last row, the group record ID looks cut off Group_Member__c:{Id=a181K000005jd11QAA, Contact__c=0031K00002tTqaQQAS, Group__c=a171K00000 Query is list<...
0
votes
1answer
24 views

ERROR: must implement the method: System.Iterable<SObject> Database.Batchable<>.start(Database.BatchableContext)

global Class Batchsample implements Database.Batchable<Attendance__c>{ global Database.QueryLocator start(Database.BatchableContext BC){ String Query = 'select id,Login_Date_c,...
0
votes
1answer
19 views

Tryning to do a SOQL in my class to retrieve records from a range of Dates

I'm trying to get just records that the end date is > than 2 years ago, but I couldn't find a way. That is what I've tried, but it just return the records until today, and I have to get the ...
0
votes
1answer
17 views

how to query for data that combines pricebook data + product data

H everyone, I am querying for some SF data for my frontend web app (a online restaurant) and have the below query `SELECT Name, UnitPrice FROM PricebookEntry WHERE Pricebook2Id = '01s5I000001FeddQAC' ...
0
votes
0answers
43 views

Getting Error while querying Account list -sosl -salesforce

I am getting error while querying Account & cusst obj Customer ,Below is my error and query. Error :"Line: 9, Column: 29 Incompatible types since an instance of List<SObject> is never ...
0
votes
0answers
22 views

Need to pull campaign members form Salesforce to marketing cloud

I need to pull the data from the campaign members object in sfdc and another custom object and then use the data for a Journey, is that possible.
0
votes
1answer
17 views

query products from pricebook to React

I recently had a question on how to query a list of products from a pricebook and was told that i could use the below to do so [SELECT Id, Product2Id, Product2.Name FROM PricebookEntry WHERE ...
0
votes
1answer
63 views

GROUP BY sentence in ExecuteSOQL within a Flow builder

I realized that I can use ExecuteSOQL to run a SOQL query within a flow. It works perfect. But when I use a SUM() and Group By sentence, the flow display Invalid interview state after the screen 01, ...
0
votes
1answer
29 views

Querying Opportunity Field History for a custop lookup fields gives 2 record back for a single change in the field

I am trying to query Opportunity Field History to get the results for a custom lookup field that has history tracking. I am getting 2 records back for 1 single change, one of the record has oldvalue ...
2
votes
2answers
72 views

Single quotes in query

We have a custom object with fields that are alphanumeric plus * ' ( ) and - . My query works fine for everything but a single-quote. I need to search a specific field (in this example it is Name) ...
0
votes
0answers
45 views

How to get the class Name that created a scheduled job?

I have a list of scheduled jobs with me for which I want to find out the class Name associated to it. I was able to get the list of all the classes that uses the schedulable interface, but I want to ...
0
votes
1answer
28 views

Excluding a DE from Contact Deletion

I have a question about Contact Deletion: How could I proceed if I want to exclude from Contact Deletion of All Contacts, a DE that is populated daily with the contacts injected in JB through ...
1
vote
1answer
1k views

How to fix error 431 Request Header Fields Too Large . HTTP CODE[431] in Anonymous Window

I'm getting this error when I execute a query and call a method inside the anonimous window. It's strange because I've executed a code very similar in length before and I've never seen this error. I'...
0
votes
1answer
24 views

Query activity returning rows that it shouldn't

I have a query activity that is returning rows that it shouldn't I'm guessing there is a problem with my sql but cannot figure it out. The idea of the query is to create a 'dormant' list, with these ...
0
votes
1answer
44 views

Exporting a file from a data extention automation in salesforce marketing cloud

There is a database extension in salesforce marketing cloud that I need to export from the automation. I didn't create the DE and am unsure how to export it for use outside of salesforce marketing ...
0
votes
1answer
64 views

SFMC Duplicate Contacts Query

I am trying write a query that will result in duplicate SFMC contacts in a SFMC list. More specifically, I have 3 brands and each has a shared publication list then there is the All subscriber List. ...
0
votes
2answers
72 views

SOSL Query and Update

I am practicing SOSL queries. I tried to find the matching records of given Email ID across all objects and update it to new Email ID using SOSL query. My Code: public class Soslxmpl{ public List&...
0
votes
1answer
16 views

Why does my conditional average query return 0 in MC Query?

I have a table that I am trying to calculate average values based on conditional statements. I have used conditional statements before so I know the function is supported, but for this particular ...
0
votes
1answer
70 views

How Order By Id works in SOQL

I am surprised to see below results. And below code prints a>b String a = '0014K000002axOZQAY'; String b = '0014K000002axOaQAI'; if(a>b){ System.debug('a>b'); } else { system.debug('...
0
votes
1answer
20 views

18 Digit Id Casing Method - Sudden Change in Processing Ids

I have a process that takes a case id from a url param through js, cases the id correctly (as ids are case sensitive), and passes it to an apex method through an action function. This process has ...
-2
votes
1answer
38 views

Is it possible to merge Data from List and Data Extension via query in Marketing Cloud? [closed]

Is it possible to merge Data from List and Data Extension via query in Marketing Cloud? I need to create a Data Extension with SubscriberKey from the list and FirstName from the Data Extension. Which ...
1
vote
0answers
42 views

SOQL query with 'LIKE not giving expected results

In my org, I've set up some custom metadata on which I have all text fields which I am querying. On my query without anything in the where condition SELECT Label,Fields__c,Labels__c,Scheme__c from ...
1
vote
1answer
44 views

Unable to Perform SOQL Query Involving Lookup Field

I have a custom object (Registration__c) that has a lookup field (Approver__c) to the standard User object. I'm trying to construct an SOQL query that will return the user's ID. My assumption is ...
3
votes
1answer
30 views

Can There be Multiple Result IDs for a Query Operation Result?

When retrieving the result of a batch of a query bulk job, according to the documentation, the following is returned. <result-list xmlns="http://www.force.com/2009/06/asyncapi/dataload"> <...
6
votes
1answer
192 views

SOQL bug for null required-lookup fields?

It appears that querying null values for required lookup fields always returns 0 results, even if some records have no value in the required field (e.g. records created before the field was made ...
0
votes
0answers
32 views

Error in query with Synch DE

I have synchronized two De from sales Cloud successfully and I'm now trying to run a query using them. I get an error message which tells they are unknown. I wonder which can be the error causing ...
0
votes
1answer
75 views

Contact fields not accessible in SOQL Query on User

I am working with Community users and I need to query both their User and Contact details at the same time. When I am performing a relationship query like [Select Id, Email, ContactId, Contact....
0
votes
1answer
36 views

Automation studio - Error in Query script

I'm running a query with the following structure SELECT * FROM [nameDE] WHERE PersonhasOptoutOfEmail = No I got an error message on the WHERE condition and I don't understand which is the issue. ...
0
votes
2answers
31 views

Duplicate data from a synchronized data extension- Can't see the Syn DE in Automation studio

i'm working in Automation Studio in order to duplicate the data of synchronized DE into a new sendable DE. The problem I have is that I see the synchronized DE in Contact Builder but I can't find it ...
1
vote
0answers
29 views

INVALID_TYPE ERROR while querying using REST API

I'm trying to run a query using REST API (RestSharp). This is my query: [SELECT Id FROM Account] This is my code: RestClient m_Client = new RestClient("https://my_instance.salesforce.com"); string ...
0
votes
1answer
22 views

When I am querying from User object facing error Illegal assignment from List<User> to List<User>

When I am doing two SOQL queries in an apex method on User Object, facing an error like- User u = [SELECT Id, IsActive FROM User WHERE username = 'some username']; List<User> userList = [...

1
2 3 4 5
28