making sure a variable doesn't equal another variable
Hi,
I want to generate a random number but make sure that the number doesn't equal another number in a recordeet. I am using this but I don't think it's right.
<cfoutput query="rsHistory">
<cfset historyid = RandRange(1,1999999999)>
<cfif #historyid# EQ #rsHistory.history_id#>
<cfset historyid = RandRange(1,1999999999)>
</cfif>
</cfoutput>
Is there a better way of doing this?
Thanks,
MIke
EDIT: I'm using coldfusion 8
