Iterating lookup values

Iterating lookup values

I have the following code which iterates the results of a search. I then want to display the results. The field Species is a multi value lookup field...

<%{
    SpeciesCV  =  Studies  [ID != 0];%>    Species<%for each RowV in Studies  [ID != 0]
    {%>        <table >
<tbody>
<tr>
<td><%=RowV.Title%></td>
<td><%=Species[ID = RowV.Species].Species%></td>
</tr>
</tbody>
   </table>    <%}
}%>


The problem is RowV.Species only returns the list of IDs.

I found a suggestion to use <%=Species[ID = RowV.Species].Species%> but this returns the same value for each row.

Any suggestions ?

Thanks