• woody_rd (9/5/2012)


    Sorry for the confusion, guys. Let's see if this explains it better. I have come across an issue where a table logs conditions with

    a timestamp, eventid and eventtype. The condition 'Session_End_Prompt_Sent' with EventType = 11 is being logged before the condition

    'LB_CLOSED_NEVER_STARTED' with EventType = 117. This is being logged typically within a few seconds, but definitely within a minutes

    time of each other based on the Timestamp column. This should not happen. I need to know how many times this occurs within the table

    but haven't been able to make a query work to get me that information.

    Example:

    Condition Timestamp EventID EventType

    Session_End_Prompt_Sent 2012-09-04 00:08:00.7076468818 11

    LB_CLOSED_NEVER_STARTED 2012-09-04 00:07:59.9236468833 117

    Once again, any help is appreciated.

    Does it not matter that the EventID is different?

    Is the EventID the PK?

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden