Converting from Access to MSSQL - rnd function

I am converting this code from Access to MSSQL,

I have an error that reads:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]'rnd' is not a recognized function name.

The code says:

Randomize
R=clng(1E6*rnd)
strSQL = "SELECT * FROM [feedback] WHERE feedbackstatus = 'show' ORDER BY rnd(-(1000*dc_feedbackKey)* " & R & ")"

It randomizes the set of records.
Anyone know how to write this out for MSSQL?

Also is there an online reference for comparrissons between Access, MSSQL, and MYSQL for ASP code?

Thx
LVL 3
Insomniac_PhDAsked:
Who is Participating?
 
fritz_the_blankConnect With a Mentor Commented:
so, perhaps this?

strSQL = "SELECT * FROM [feedback] WHERE feedbackstatus = 'show' ORDER BY RAND(-(1000*dc_feedbackKey)* " & R & ")"


FtB
0
 
fritz_the_blankCommented:
http://dev.mysql.com/doc/mysql/en/index.html

You need to use ROUND(X) , ROUND(X,D)


FtB
0
 
fritz_the_blankCommented:
Unless you want random, which is:

RAND() , RAND(N) <--N is the seed

FtB
0
All Courses

From novice to tech pro — start learning today.