I have a journal table that keeps track of changes made, the system creates a new incremental record every time something is changed on the primary record.
I want to identify and capture records from the journal table where a specific field (company type) changes value, capturing the new company type, company code and the date it was changed, all values that will be in the journal record. To do this I need to read through all the records for each company in Company ID / chronological order from oldest to newest based on the date changed. It's possible that for many companies this value might never change at all.
I know it means using some kind of group by... having structure, but I cannot figure out how to set it up properly. No matter what I try I'm not getting the result set back that I want.
Can anyone help me figure this out? Thanks.
CraigHartz
I want to identify and capture records from the journal table where a specific field (company type) changes value, capturing the new company type, company code and the date it was changed, all values that will be in the journal record. To do this I need to read through all the records for each company in Company ID / chronological order from oldest to newest based on the date changed. It's possible that for many companies this value might never change at all.
I know it means using some kind of group by... having structure, but I cannot figure out how to set it up properly. No matter what I try I'm not getting the result set back that I want.
Can anyone help me figure this out? Thanks.
CraigHartz