I have a record example and some sql that I want to find out how to find the last record of each group (caseno) and see if there is a date difference > 1 day.
If there is a date difference > 1 day then put the flag = 'Y', if not, flag = 'N'.
This is based on the 'tid_action' column = 'EA'. So look for each row = 'EA' and using the create_date of the most recent row - date_begin of the next recent 'EA', as highlighted in the example data file.
Is this better to be accomplished in a cursor or can this be done in another way.
Other file is the sql that retrieved the records in the output file, I started to create the cursor but don't know if this was the best way to approach this or not.