Last active
October 31, 2020 13:03
-
-
Save MamaiRachid/ee9a3957fa6c14e44c8b22b3ff15459b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
comp.SubscriberKey, | |
comp.jobid, | |
eventdate, | |
emailname, | |
Domain, | |
ISNULL(comp.OYBAccountID,comp.AccountID) as OYBAccountID, | |
comp.AccountID | |
FROM _Complaint comp | |
INNER JOIN _job j ON comp.jobid = j.jobid | |
AND convert(date, comp.eventdate) >= dateadd(day, datediff(day, 0, getdate()) - 1, 0) | |
AND convert(date, comp.eventdate) < getdate() | |
AND ((OYBAccountID IS not null and OYBAccountID = 50000XXXX) OR (OYBAccountID IS null)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment