Skip to main content

#SQL0 debatiendo

Hi everyone, all good? I need some help with Automation Studio/Query Studio. I'm trying to create a column break for specific columns. Here's the SQL code I wrote: 

 

SELECT SubscriberKey, [Individual-Id], EmailAddress, FormattedE164PhoneNumber, CountryId, 

JSON_VALUE(SalesOrder, '$[0].ConfirmationDate') AS ConfirmationDate, 

JSON_VALUE(SalesOrder, '$[0].Name') AS Name, 

JSON_VALUE(SalesOrder, '$[0].[RetailStore_Id]') AS [RetailStore_Id] 

FROM CONVITES_05E06_CONVITES_05E06_1sgU60000007Pw9IAE_85RU6000000AFozMAG 

 

It's giving me "Automation failed due to system error." Even though I followed all the rules, could you please help me? Thank you! 

 

@* Marketing Cloud Intelligence *

#Email Marketing

3 respuestas
  1. 27 nov 2025, 11:44

    I'm seeing the same kind of error. Someone, please help me fix it. 

    Automation failed due to a system error.

     

    SELECT 

    rlc.Id

    rlc.FirstName, 

    rlc.LastName, 

    rlc.Email, 

    COALESCE(ls.Preferred_Language__c, rlc.Preferred_Language__c) AS Preferred_Language__c, 

    COALESCE(rca.AccountName, rlc.Company, ls.Company) AS Company, 

    COALESCE(rca.AccountType__c, ls.AccountType1__c) AS AccountType__c, 

    rlc.HasOptedOutOfEmail 

    FROM [Refreshed Leads and Contacts] rlc 

    LEFT JOIN [Refreshed Contacts and Accounts] rca 

    ON rca.ContactId =

    rlc.Id

     

    LEFT JOIN [Lead_Salesforce] ls 

    ON

    ls.Id = rlc.Id

     

    WHERE 

    (rca.AccountType__c IN ('Advertiser/Merchant','Agency') 

    OR ls.AccountType1__c IN ('Advertiser/Merchant','Agency')) 

    AND(rlc.HasOptedOutOfEmail = 'False' 

    OR rlc.HasOptedOutOfEmail IS NULL) 

    AND(rlc.Do_Not_Email_ContactStatus__c = 'False' 

    OR rlc.Do_Not_Email_ContactStatus__c IS NULL)

0/9000

Salesforce AppExchange for @* Marketing Cloud Engagement * - when should you consider it based on the segmentation use case example: https://mateuszdabrowski.pl/docs/config/sfmc-config-appexchange-solutions/  

 

Check out: 

➡️ Expectation management for SFMC AppExchange world 

➡️ Step-by-step guide on where to find the solution for your feature request 

➡️ Out-of-the-box vs Custom vs Off-the-shelf 

➡️ SFMC Segmentation state of the game 

➡️ #SQL Query Studio 

➡️ DESelect Segment 

➡️ Activation Studio  

 

More to come, so keep on making your life easier ;)

3 comentarios
0/9000

Native Integration with Data Cloud: Salesforce Developers Ask Me Anything November 2024

 

Join host @Alba Rivas and product experts @Amrinder Chadha, @Diana Jaffe and @Minhaj Khan for an in-depth discussion on integrating @* Data 360 * with the Salesforce Platform for agents.

 

Discover how to unlock the full potential of Data Cloud using familiar platform features including fields, related lists, flows, and advanced data objects (DMOs & DLOs) through #SOQL and #SQL in #Apex.

 

Bring your technical questions and get ready to explore how #Agentforce can help streamline and enhance your agent workflows.

 

Click here to register now.

 

*All AMAs are recorded and can be watched on demand on our YouTube channel.

Native Integration with Data Cloud: Salesforce Developers Ask Me Anything November 2024 Join host and product experts , and for an in-depth discussion on integrating with the Salesforce Platform for a

#Flow #Einstein Search #Enrichment Tools #Fields & Relationships #DMO

0/9000
2 respuestas
0/9000

I have two fields  Last Pay Date and Payment Due Date so if someone missed there Payment due date by 5 days I want those records.

Now the issue is i dont have extra field to identify the days the missed by.

want to use Last Pay date and if Last Pay Date is not Payment Due date then calculate the days ?

 

Thanks,

Malik

 

#SQL @Mateusz Dąbrowski

2 respuestas
0/9000

Can anybody help with SQL Query to pull date 1 day greater than current date apart from the standard condition ie CHKOUT_DT  = DATEADD(dd,1,GETDATE()) which seems not be working properly

 

#Sql Queries #SQL

1 respuesta
  1. Nobuyuki Watanabe (NAC / FPT Japan Holdings Group) Forum Ambassador
    5 ene 2024, 10:28

    Hi, @Anirudh venugopal

    The function GetDate() displays the time up to seconds, so it is necessary to use conversion functions like Convert to eliminate the display of hours, minutes, and seconds.

     

    Additionally, GetDate() is presented in the CST (Central Standard Time) timezone. Therefore, instead of simply adding one day, you should add the time corresponding to your timezone. In my country, Japan, we use JST (Japan Standard Time), and there is a 15-hour difference with CST. So, to represent one day later, you should add 15 hours to 24 hours. (= 39 hours.)

     

    Please adjust the logic according to your country's timezone:

    CHKOUT_DT = Convert(Date,DateAdd(hh,39,GetDate()),111)

0/9000

@* Marketing Cloud Engagement * #SQL JOIN Cheat Sheet is here!

The idea is not new, but I enhanced it with SFMC-focused use cases and query examples. Want to learn more? Check out my guide: https://mateuszdabrowski.pl/docs/sql/sfmc-sql-join/

JOIN Cheat Sheet is here!The idea is not new, but I enhanced it with SFMC-focused use cases and query examples. Want to learn more?

0/9000

I finally finished the next SFMC #SQL guide

This time, about nothing creating a lot of issues - a 𝐍𝐔𝐋𝐋: mateuszdabrowski.pl/docs/sql/sfmc-sql-null-functions/  

 

Check out: 

➡️ What is NULL? 

➡️ Why you have to think about it when you write a query? 

➡️ How to check whether you have NULLs in your data? 

➡️ What you can do to solve NULL-based issues?  

 

In other words, prepare for NULL, IS NULL vs ISNULL, COALESCE and NULLIF in @* Marketing Cloud Engagement *  

 

More to come, so keep on querying!

2 comentarios
  1. Mateusz Dąbrowski (mateuszdabrowski.pl) Forum Ambassador
    10 jul 2022, 8:31

    Been there, didn't factor it either in the past, @Tim Ziter - that's a massive trap for people coming from non-SQL environments and more accustomed to different languages that don't have this issue. 

0/9000

Our Data & Analytics team at VillageMD is #hiring a Senior Analyst!

 

Beyond #SQL and #Tableau, preferred qualifications include #agile and #healthcare experience - with the full job posting below.

 

Please note that this role is remote.

 

Link to apply here : https://www.villagemd.com/open-positions?gh_jid=5476842002

2 comentarios
  1. 16 mar 2022, 9:12

    Are you open to taking candidates based our of your country? In case you are, can we connect to discuss further?

0/9000