0

I would like to write a query to find subscribers who opened emails sent from journey builder in the previous month, but this query returns 0 records. May I know where I did wrong, please? Thank you.

Select
j.JobID,
j.EmailName,
j.DeliveredTime as SendTime,
o.EventDate as OpenTime,
s.EmailAddress,
s.SubscriberKey
from [_Job] j
join [_Open] o
on j.JobID = o.JobID
join [_Subscribers] s
on o.SubscriberID = s.SubscriberID
where
o.IsUnique = 1 and
DATEPART(Y,o.EventDate) > DATEPART(Y,DATEADD(M, -1, GETDATE())) and
j.EmailID = 47493
0

First of all, you can try replacing:

join [_Subscribers] s

with:

join ent._ListSubscribers s

If still not working, you may compare both years and months like instead of:

DATEPART(Y,o.EventDate) > DATEPART(Y,DATEADD(M, -1, GETDATE())) and

this:

DATEPART(m, o.EventDate) > DATEPART(m, DATEADD(m, -1, GETDATE())) and
DATEPART(yyyy, o.EventDate) = DATEPART(yyyy, DATEADD(m, -1, GETDATE())) and /*/ if still in the same year /*/
| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.