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
0answers
17 views

Update Open Date Based Send Open Time

I currently have a salesforce query that updates a customers last open date if they opened the previous day. I would like to add a stipulation to this that says 'OpenTime cannot equal SendTime if they ...
0
votes
1answer
30 views

Marketing Cloud replace function in SQL [closed]

In my scenario I have to replace the new line character in a record for a particular column to some other character. I have tried below query but got the error. select CAST(REPLACE(REPLACE(CAST(a.[...
1
vote
1answer
41 views

MC query dedupes records automatically

I've noticed some quite odd behavior from running queries in automation studio. Below is the query in question: SELECT C.id , CM.id FROM ent.CampignMember_Salesforce CM JOIN ent.Contact_Salesforce C ...
3
votes
1answer
67 views

Which Tooling API Objects can be queried in Apex?

I would like to know which objects I can query in Apex which are not listed in the SOAP API Developer Guide but are listed in the Tooling API Developer Guide. Is there a list maintained somewhere?
0
votes
0answers
18 views

adding an existing user to my sales app

scenerio: .......both user A and B are on salesforce...... user A runs a little Ad agency, user B requires the help of User A, as a mentor. My Question: why can't it be possible for user B to invite ...
0
votes
1answer
26 views

Query based on variable field name

I would like to know that how can we search based on a custom field via a variable. For example, if I create a custom field Mobilephone for the standard object Account, then how can I search this ...
0
votes
2answers
52 views

How can I make a year in a SOQL query variable?

So I can run a query such as WHERE Date__c > 2020-07-31 but then next year "2020" would be out of date. I'd like "2020" to be variable so that next year, when I run this again, ...
-1
votes
1answer
36 views

Child to parent SOQL query inside a parent to child query

I need a query to get the Name of the records referenced in the WhatId and OwnerId fields of the ActivityHistories related to a contact. How can I go about bulding this query? This is what I have so ...
0
votes
1answer
59 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 ...
0
votes
1answer
57 views

Unsubscribe data view Timed Out

I'm trying to get all the unsubs in MC with Unsub Data view, the query that I'm using : select j.JourneyName, ja.ActivityName as 'EmailName', su.EmailAddress, u.SubscriberKey as 'ContactKey', u....
0
votes
1answer
35 views

How to get a report of deleted records list by a user in Salesforce?

I just wanted to get a report in salesforce on Account deleted records by a specific user. Did anyone have idea kindly please help Thanks, Ram Kumar
1
vote
0answers
33 views

Count id in Data Extension and Upsert to another Data Extension using SSJS

This question might be a basic one but I am very new to SSJS so thank you for your understanding. The data extension names JourneyA, JourneyB, JourneyC...infinity are the result of Journey Builder. ...
0
votes
1answer
31 views

How to create a query that returns only cases on the platform that have more than 10 years since the creation date?

How to create a query that returns only cases on the platform that have more than 10 years since the creation date? I did this query but it returns data with less than 10 years of creation. SELECT ID, ...
0
votes
2answers
45 views

Handling Null values in query [closed]

I want to avoid subscribers with the UtmSource value: 'https://survey.wilke.dk/' to enter my welcome flow. First thing I did was search for that exact value and found 6 subscribers with this UtmSource ...
1
vote
1answer
12 views

NotifyForFields what is the difference between Select vs Reference type?

There're multiple notification types for push topics defined by the field NotifyForFields. I'm trying to understand the difference between NotifyForFields Set to Select and NotifyForFields Set to ...
0
votes
1answer
59 views

Query Activity - Merging Data Extensions with Different Column Names [closed]

I have a Data Extension called “Merged Data Extension Newsletter” that has fields called “FirstName”, “LastName”, “Email”, and “Id” I am using ID as the Primary Key. I have another Data Extension ...
0
votes
1answer
35 views

Rest api get endpoint with bind var in query

I want to bind variable in get request, but it gives me error "Bind variables only allowed in Apex code","errorCode":"MALFORMED_QUERY"}". How to do it? Account ...
-2
votes
1answer
45 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
2answers
74 views

Soql query to check record type

I want to check the record type of Account before doing anything else. I have the following method: public static void methodName(Id accountId) { // get account record ...
0
votes
1answer
29 views

DATE function to get past 60 days of data

I am running a query to get data from the past 60 days and BEYOND. So basically I am trying to capture anyone whose installdate is Today - 60 days and beyond. And I should be getting data whose ...
0
votes
1answer
56 views

Merge identical records with batch apex, turn not identical fields in said records into a multipicklist

I'm a novice and this is my first post here so I apologize if im doing this wrong I have a requirement where i need to use batch apex to: Merge records with the identical fields "Name" and &...
0
votes
1answer
62 views

SQL Query to find Duplicate email under different ID [closed]

I am trying to run a SQL to get a list of Distinct email ID. For example if the John Does john@somebody.com Jane Doe john@somebody.com Alice J mary@abc.com I want my output to have only Jane Doe ...
1
vote
2answers
105 views

SOQL with standard objects relationship query help

I need to combine these 2 queries so that I get the Case Members and Case details in one result. There are no custom fields/objects. Both queries run independently but when I try the subquery/...
-2
votes
1answer
35 views

Getting data for Enhanced Profiles via API query

First of all, I want to say I'm not a Salesforce user, so I apologize if I misunderstand any of the basic concepts of this system. I'm writing an integration with the Salesforce API. I have been asked ...
0
votes
0answers
50 views

Error when deserealizing reply message from 'query' operation in .NET Core 3.1

I'm encountering the following error when using the query operation from the Salesforce SoapClient System.ServiceModel.CommunicationException: Error in deserializing body of reply message for ...
1
vote
1answer
40 views

Creating a log of all subscribers' most recent email. It's missing some people. SQL help?

For about 18 months I've been running an automation to keep a list of all subscribers and the date of their most recent email. I have two queries and two data extensions. Number 1 is: SELECT ...
0
votes
1answer
40 views

Multiple SQL statements in one Activity [closed]

We have to check in our transaction database to see if the product is bought. We get the data like: DB1 key product_1 Product_2 product_3 111 123456789 789456456 456789132 123 487462538 487454521 ...
0
votes
1answer
24 views

Query not working in MC

my query is not working, can you help me please? SELECT Id FROM DE_test1 WHERE Id="0032X00002NNlK7QAL" Error: Error saving the Query field.Incorrect syntax near 'X00002NNlK7QAL'.
0
votes
2answers
32 views

Query accounts having only closed lost opportunities

We are planning to reengage closed accounts after a certain amount of time. So, I'm trying to run a report to query accounts that have only closed lost opportunities. But I'm unable to query accounts ...
0
votes
0answers
36 views

How can I add to my list a manual field

How can I add to my list a manual field (oName), because I want to add the object name of the query. In other sql I can use syntax below. SELECT Id, Name, createdDate, 'value' as oName FROM TASK ...
1
vote
1answer
31 views

SFMC Dynamic Timezone Sends

Timezones are a concept I have a hard time wrapping my head around. I'm trying to build a dynamic timezone program that runs an adjusted sendtime on a daily basis. Everyone should be receiving an ...
0
votes
0answers
44 views

error while querying tooling api for FullName EVEN WHEN LIMITED TO ONE RESULT

I've been using the tooling API to query layouts and I need to access the metadata or FullName fields. I know I can only use this with a single row at a time, so I either loop over all layouts with a &...
0
votes
1answer
30 views

Concatenate data of different objects in one list

I want to create an overview of a list which contains content from different objects. I will try to add in this list the files, tasks, events, emails and notes. If I query for each object a list, how ...
-1
votes
1answer
18 views

How do I get records when Id's are in a text field of an object. These Id's are Ids of duplicate record and need to be eliminated using a flow

I am trying to extract IDs from a text field and trying to get records of the ID that are in the text field. Basically, the text field stores the IDs of duplicate records and only one of the records ...
0
votes
1answer
41 views

Soql query to retrieve data from three related object

I have three custom objects: Book, Loan, and Reader. Loan is a junction object with lookup relationship with both Book and Reader. The diagram below shows their relationship: I want to write a SOQL ...
0
votes
2answers
24 views

Problem with 'OR' on this SOQL?

SELECT Id, F1, F2, F3, F4 FROM Account WHERE F1 = false AND F2 IN :list OR ( F3 = '001' AND F4 = '002'); This query throws this error: System.QueryException: unexpected token: OR If I put AND, it ...
0
votes
1answer
53 views

Create a Master DE of Subscribers in a Child BU

Hangup: We have four separate "master DE's" being imported from IT into our marketing child business unit, each segmenting customers a different way. There is overlap between the four. Goal: ...
0
votes
0answers
40 views

Filter Knowledge Articles search results by Brand (WHERE Brand = ...)

I'm making a custom Knowledge Search (it needs to be custom), and the basic query to search articles is 'SELECT Id, Title, Summary FROM Knowledge__kav WHERE Title LIKE \'%' + input + '%\''. This is in ...
0
votes
1answer
115 views

REQUEST_RUNNING_TOO_LONG :Your request was running for too long, and has been stopped

I have created a Batch which is supposed to pull Completed tasks and Reopen them. It's a simple implementation (code attached), but what i observe is the Query is taking too long and ultimately aborts ...
0
votes
1answer
47 views

Query data from different object

I have 2 custom objects. Let's name it to object 1 and object 2. Both of these objects have their own field. Object 1 have fields: Customer name, item, quantity, total, ..... object 2 have fields: ...
0
votes
0answers
72 views

How to get only active workflow rules

Tooling API help to get all workflow rules, But I need only active workflow rules. How to get the active property information. for all workflow rules (Including inactive ) /services/data/v36.0/tooling/...
7
votes
1answer
476 views

SOQL query to fetch records with reserved characters ('*', '/', '(', ')')

Hoping there is a simple answer that I am overlooking. Currently, we are able to search for the following reserved characters with an escape sequence, eg a backslash character '\', in SOSL: & | ! ...
1
vote
2answers
61 views

Joining SendLog and Click Data View does not return any results

I want pull out the list of customers that did not click on the mail we sent. We maintain a SendLog in which we have additional attributes logged (Example: emailname, subject etc.) I understand that ...
0
votes
1answer
22 views

Querying multiple tables when single field contains polymorphic Ids

I have a text field called "references" that holds Id's of Other objects. Now, I want to get records that are in "references" by searching all the objects. Map<Id, CustObj1__c&...
0
votes
0answers
33 views

Assistance with GROUP BY SOQL Query

I have created a Conga Composer SOQL query that takes a bundled product with recurring and non recurring items, sums them by charge type, and masks the child products with the bundle parent name and ...
2
votes
1answer
129 views

Bulk API v2 Query job not returning results in same order as that of SOQL

I am using Bulk API v2 Query job to query on data from Salesforce. For example my SOQL is - select id, firstname, lastname, city, state, country from account In the response I am expecting columns to ...
0
votes
0answers
52 views

Query for all subscribers AddMethod, DateModified, DateCreated for mismatched emails with subscriber key in SFMC?

I'm going to start by saying this forum has been nothing but helpful and appreciate everyone taking the time to respond to others. This is my first post so I apologize if this is not following the ...
0
votes
0answers
16 views

Error in query bindings

I wanted to create a new binding in order to be able to filter the table by Regions. Could you please help me with the query below? q = load "OpptyLineItems"; q = foreach q generate 'Id' as ...
0
votes
2answers
42 views

SOQL Query to extract certain attachments fails

I want to export attachments of those Owners who belong to a certain Organisation. I tried: SELECT BodyLength FROM Attachment WHERE OwnerId.Organisation_Name__r = 'ExampleCompanyName', but got the ...
1
vote
1answer
54 views

Querying based on user profile

I want to write queries to check what apps page layouts lightning components fields are accessible to a particular user profile for a particular object. I also want to find out whether the user ...

1
2 3 4 5
31