Salesforce Marketing Cloud queries do not allow variables or temporary tables according to the "SQL Support" section of this official documentation (http://help.marketingcloud.com/en/documentation/exacttarget/interactions/activities/query_activity/)

I have a data extension called Parameters_DE with fields Name and Value that stores constant values. I need to refer to this DE in queries.

Using transact-SQL, an example is:

SET @number = (SELECT Value FROM Parameters_DE WHERE Name='LIMIT')
FROM Products_DE
dateadd(day, @number, getdate()) < Expiry_DE.Best_Before

Is it possible to get the value for @number from Parameters_DE and use it in the dateadd() function without using temporary tables or variables?

  • Where are you writing this query? Is it the query activity ? – Maneesh Feb 28 '17 at 13:26
  • Yes, this is a query activity written in Email Studio – Index Hacker Feb 28 '17 at 14:45
  • I don't think it is possible in Query Activity. – Maneesh Mar 1 '17 at 2:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.