Agree with Dave, NSQL portlet is the most practical solution. We've done something similar using a custom DB function which either gets you the internal ID of the latest status report sub-object instance or the one immediately preceding it.
Here's the MS-SQL code for the function ( I think it was based on an existing accelerator pack one in fact).
CREATE FUNCTION [niku].[LATEST_STATUS_RPT_FCT]
(@p_projectId numeric,
@p_sequence char(4))
/* Get the ID of the latest or previous status report entry */
RETURNS numeric
AS
BEGIN
DECLARE @rptId numeric
If upper(@p_sequence) = 'CURR'
BEGIN
/* Latest block */
SELECT @rptId = id
from
(select rank() over (order by created_date asc) rank, created_date, id
from odf_ca_prog_rep r
where r.odf_parent_id = @p_projectId) as x
where rank = (select count(id) from odf_ca_prog_rep where odf_parent_id = @p_projectId)
END
If upper(@p_sequence) = 'PREV'
Begin
SELECT @rptId = id
from
(select rank() over (order by created_date asc) rank, created_date, id
from odf_ca_prog_rep r
where r.odf_parent_id = @p_projectId) as x
where rank = (select count(id) -1 from odf_ca_prog_rep where odf_parent_id = @p_projectId)
END
Return @rptId
END
Then in the portlet NSQL you can call this function in your WHERE clause or use it inside a case statement to evaluate to 1 or 0 then use that value as "Is Latest?" flag.
Owen