running a reverse auction site where say there are 5
suppliers bidding against each other and they have several bids
each. However I only want to show the last bid and ranking of each
supplier instead of all bids for all suppliers. The code below will
do this only it orders by supplier name and not by ranking order.
<CFLOOP INDEX="ListSuppliers" LIST="#Suppliers#">
<CFQUERY NAME="GetLastBid"
DATASOURCE="#Application.Datasource#">
SELECT AuctionID, SupplierID, Bid, Rank
FROM Bids
WHERE (AuctionID=<CFQUERYPARAM VALUE="#URL.AuctionID#"
CFSQLTYPE="CF_SQL_VARCHAR">) AND (SupplierID='#ListSuppliers#')
ORDER BY Scores.Rank ASC, Bids.Bid ASC;
</CFQUERY>
<CFSET LastBid=ListFirst(GetLastBid.Bid)>
<CFOUTPUT>
<tr align="center">
<td><div align="center"><font face="arial"
color="FFFFFF"
size="2">#GetLastBid.SupplierID#</font></div></td>
<td><font face="Arial" color="FFFFFF"
size="2">£#DecimalFormat(LastBid)# (Overall Rank:
#GetLastBid.Rank#)</font></td>
</tr>
</CFOUTPUT>
</CFLOOP>