First I run a simple query to get the max ID from the table, which

returns a number 10284. To which I would like to add a randomly generated number. So I get a number like '2' and it adds it and I get 10287 - which is INCORRECT! I was expecting 10286. So what am I doing wrong? I've run this dozens of times and I can't find a pattern to it...the random number is generating nicely but the results of the two values are rarely what I expect. Thanks for any help!

```
<cfquery name="Find_Max" datasource="#application.dbfile#">
SELECT max(MainID) as maxID
FROM Main
</cfquery>
Returns a number from the table like 10284.
<cfset total = val(#Find_Max.MaxID#) + val(#RandRange(1,10)#)>
<cfoutput>val(#RandRange(1,10)#)</cfoutput><br />
<CFOUTPUT>#Find_Max.MaxID# + random number = #total#</CFOUTPUT>
```