Im going to ry to word this so it makes sense
im running a query that checks the db table to see if data coming from a form is already in the table and grabs the id field from any matches. If no match (recordcount = 0) then the data gets input. If it is already there then i want to grab the id field - im doing this by saying "if query.recordcount gt 0, then set id=query.id". this works if there was only one record returned (i only need one id). How can I grab one id if more than one is returned? can i say, for instance, <cfset billingID = #max(qGetBid.bID)#> instead of <cfset billingID = #qGetBid.bID#> so that i get the highest one returned? would this work?

im running a query that checks the db table to see if data coming from a form is already in the table and grabs the id field from any matches. If no match (recordcount = 0) then the data gets input. If it is already there then i want to grab the id field - im doing this by saying "if query.recordcount gt 0, then set id=query.id". this works if there was only one record returned (i only need one id). How can I grab one id if more than one is returned? can i say, for instance, <cfset billingID = #max(qGetBid.bID)#> instead of <cfset billingID = #qGetBid.bID#> so that i get the highest one returned? would this work?