T
Tim
I have a table with the following records:
1. ID
2. Event Code
2. Transaction Create Date/Time (date/time record was created)
3. Event Date/Time (date that an event took place)
There can be multiple records with the same ID and Event Code but with
differing Trasnaction Dates and Event Dates.
I am trying to write a query where I pull out the record that has the most
recent transaction create date and pull the corresponding event date.
I've tried to sort the Transaction Create Date (desc) and use Max. That
gives me the max but when I pull the corresponding Event Date I either get
all of them (if I use first or last then I seem to get a random value instead
of always the one in the corresponding record).
Can anyone help me figure out what I need to do to consistently pull the
matching value from the Event Date when I pull out the Max of the Create Date?
Thanks in advance and I'll provide more detail if necessary.
Tim
1. ID
2. Event Code
2. Transaction Create Date/Time (date/time record was created)
3. Event Date/Time (date that an event took place)
There can be multiple records with the same ID and Event Code but with
differing Trasnaction Dates and Event Dates.
I am trying to write a query where I pull out the record that has the most
recent transaction create date and pull the corresponding event date.
I've tried to sort the Transaction Create Date (desc) and use Max. That
gives me the max but when I pull the corresponding Event Date I either get
all of them (if I use first or last then I seem to get a random value instead
of always the one in the corresponding record).
Can anyone help me figure out what I need to do to consistently pull the
matching value from the Event Date when I pull out the Max of the Create Date?
Thanks in advance and I'll provide more detail if necessary.
Tim