• I think you're making it more complex than it needs to be.. this will give you the customer_ID of everyone who attended.. once you have that list you can use it as you wish.

    select distinct CUSTOMER_ID

    FROM

    (

    select reg.CUSTOMER_ID, jh.join_date,

    case when jh.join_date BETWEEN DATEADD(mi,-45,web.START_DATE_TIME) and web.END_DATE_TIME then 'Attended Webinar' else null end as AttendedWebinar

    from Webinar.Registration reg

    INNER JOIN Webinar.Webinars web ON web.PRODUCT_CODE = reg.PRODUCT_CODE

    inner join dbo.CUSTOMER cus on cus.MASTER_CUSTOMER_ID = reg.CUSTOMER_ID

    left outer join Webinar.JoinHistory jh on jh.WEBINAR_HOST_REGISTRATION_ID = reg.WEBINAR_HOST_REGISTRATION_ID

    where reg.REGISTRATION_TYPE = 'LIVE'

    and reg.PRODUCT_CODE = @WebinarID

    and (@ReportType = case when jh.join_date BETWEEN DATEADD(mi,-45,web.START_DATE_TIME) and web.END_DATE_TIME then 'Attended Webinar' else 'Did Not Attend Webinar' end

    or

    @ReportType = 'All Webinar Registrants')

    ) SOURCE

    WHERE AttendedWebinar is not null