• danawexler (4/29/2013)


    i'm stuck!! i'm trying to determine if a customer attended our webinar based on their log in date/time - that's the easy part. but there are many customers who logged in several times, and using a case statement is not working the way i need it to. below is a snippet of my code:

    case when jh.join_date BETWEEN DATEADD(mi,-45,web.START_DATE_TIME) and web.END_DATE_TIME then 'Attended'

    else 'Did Not Attend' end

    and this works if a customer ONLY logged in during the specified times. however, if they logged in during the event AND logged in prior to or after the event, they will be listed multiple times. makes sense so far, except i need either/or. i've tried to re-write my query several times, but i'm not able to exclude those records that fall outside of the specified time.

    thanks in advance for your help!

    Hard to give you an answer based just on what you posted. Can you post the DDL for the table(s) involved, some sample data that mirrors your current data, the expected results, and what you have tried so far?