Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sql777
Constraint Violating Yak Guru
314 Posts |
Posted - 2007-05-09 : 16:41:47
|
| Hi,I need to select a random number between 999900000 and1000897681.When I use:select round(rand() * 1000897681, 0)I get a number from 0 to 1000897681, but I a random number from within a specified range. |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
|
|
sql777
Constraint Violating Yak Guru
314 Posts |
Posted - 2007-05-09 : 16:56:52
|
| Actually I just did this:select round(rand() * 997681, 0) + 999900000(997681 = upper bound - lower bound) |
 |
|
|
|
|
|