Hi,
Apologies!
I did the following (my simple example was so that I didn't have to write loads of columns, etc...).
select customer_id, {all other fields}, max(valid_from) from (
select customer_id, {all other fields}, valid_from from table where ( all exclusions, etc )
) group by...