Salesforce Certified Marketing Cloud Engagement Developer free question 9 / 10 · Domain 4: Data Management
A SQL Query activity filters a large send table by date and runs slowly. Which WHERE clause follows the page's guidance on searchable arguments?
- WHERE DATEDIFF(DAY, SendDate, GETDATE()) <= 10
- WHERE SendDate >= DATEADD(DAY, -10, CAST(GETUTCDATE() AS DATE))
- WHERE NOT SendDate < DATEADD(DAY, -10, CAST(GETUTCDATE() AS DATE))
- WHERE CONVERT(DATE, SendDate) >= CONVERT(DATE, DATEADD(DD, -10, GETUTCDATE()))
Show the answer and explanation
Answer: B
Why this is correct
A searchable argument can use an index. The page lists OR, NOT, the < and > operators, NOT EXISTS, NOT IN, NOT LIKE, and intrinsic functions on a column value as non-searchable in a WHERE clause, and it rewrites a date function into a plain comparison with DATEADD on the other side. Keep the column bare, as in the first clause.
Why the other options are wrong
"WHERE CONVERT(DATE, SendDate) >= CONVERT(DATE, DATEADD(DD, -10, GETUTCDATE()))" … A function that works on the column value, such as CONVERT on SendDate, is not searchable and cannot use an index. The page rewrites it as a comparison of the plain column.
"WHERE DATEDIFF(DAY, SendDate, GETDATE()) <= 10" … DATEDIFF on the column is an intrinsic function that works on the column value, so it is not searchable.
"WHERE NOT SendDate < DATEADD(DAY, -10, CAST(GETUTCDATE() AS DATE))" … NOT is on the list of non-searchable arguments, along with OR, the < and > operators, NOT EXISTS, NOT IN, and NOT LIKE.
Key point
Keep the column bare in WHERE and put the function on the other side.