?
Solved

Converting from Access to MSSQL - rnd function

Posted on 2005-03-08
3
Medium Priority
?
445 Views
Last Modified: 2008-02-26
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
0
Comment
Question by:Insomniac_PhD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 13489700
http://dev.mysql.com/doc/mysql/en/index.html

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


FtB
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 13489734
Unless you want random, which is:

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

FtB
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 2000 total points
ID: 13489821
so, perhaps this?

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


FtB
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question