Not sure if you could do it in one step, but you could try using the 'distinct' command to get the first records of each cp/period - IIRC you can only retrieve the fields that you actually want to be ...