Link to home
Start Free TrialLog in
Avatar of Insomniac_PhD
Insomniac_PhD

asked on

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
Avatar of fritz_the_blank
fritz_the_blank
Flag of United States of America image

http://dev.mysql.com/doc/mysql/en/index.html

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


FtB
Unless you want random, which is:

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

FtB
ASKER CERTIFIED SOLUTION
Avatar of fritz_the_blank
fritz_the_blank
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial