hi peeps,
i have here a code of the contents in a field fetched from the database. the ProductID is looped until all are displayed, which depends on the sql. i put a comma after a ProductID so that all ProductIDs are displayed separated by a comma and a single space. my problem is that after the last ProductID, there is still a comma displayed. how can i remove the comma after the last ProductID??
hope you got what i mean and can help me with this problem.
thank you once again and more power to you & daniweb!!
<%do until rsprd.eof%>
<%'sTotal = 1%>
<%lght = Len(rsprd("ProductID"))%>
<%if lght = 1 then%>
<%if rsprd.recordcount = 1 then%>
<font size="2" face="Arial" color="#000000">P-000<%=rsprd("ProductID")%>,</font>
<%else%>
<font size="2" face="Arial" color="#000000">P-000<%=rsprd("ProductID")%>,</font>
<%end if%>
<% elseif lght =2 then%>
<%if rsprd.recordcount = 1 then%>
<font size="2" face="Arial" color="#000000">P-00<%=rsprd("ProductID")%>,</font>
<%else%>
<font size="2" face="Arial" color="#000000">P-00<%=rsprd("ProductID")%>,</font>
<%end if%>
<%elseif lght = 3 then%>
<%if rsprd.recordcount = 1 then%>
<font size="2" face="Arial" color="#000000">P-0<%=rsprd("ProductID")%>,</font>
<%else%>
<font size="2" face="Arial" color="#000000">P-0<%=rsprd("ProductID")%>,</font>
<%end if%>
<%elseif lght = 4 then%>
<%if rsprd.recordcount = 1 then%>
<font size="2" face="Arial" color="#000000">P-<%=rsprd("ProductID")%>,</font>
<%else%>
<font size="2" face="Arial" color="#000000">P-<%=rsprd("ProductID")%>,</font>
<%end if%>
<%end if%>
<%rsprd.Movenext
loop
sTotal = sTotal + (rsprd.recordcount)%>
<%'else%>
<%'end if%>
</font>
<%end if%>