• Thank you, Grasshopper. One of the criteris is not met with this query:

    where a transaction number exists more than once and where at least one existence has CancelDueToCorrection ='Y',

    The query you've provided does not return #5.