We would like to get all opens data together with email sent/delivered data for the last 6 months. The goal is to separate openers from non-openers by filtering the resulting data extension. We are using an SQL which produces results, however the target data extension cannot be filtered on EventDate (email open time), as all records have open-time, even though we used LEFT JOIN between _sent and _open data view. Did I join on the wrong field? Here's the code:
SELECT DISTINCT
CONVERT(varchar,s.EventDate,20) AS SentDate,
s.subscriberkey,
CONVERT(varchar, o.EventDate,20) AS OpenDate
j.emailname,
j.emailid
FROM _Sent AS s
LEFT JOIN _Open AS o
ON s.jobID=o.jobID AND s.subscriberID = o.subscriberID
AND o.IsUnique = 1
AND CAST(s.EventDate as date)>=CAST(getdate() -180 as date)
INNER JOIN _Jobs AS j
ON s.jobid = j.jobid