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
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)
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
Unless you want random, which is:
RAND() , RAND(N) <--N is the seed
FtB
RAND() , RAND(N) <--N is the seed
FtB
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You need to use ROUND(X) , ROUND(X,D)
FtB