Solved

Arithmetic overflow error converting expression to data type int

Posted on 2006-06-14
3
560 Views
Last Modified: 2008-02-01
I am getting the following error below:

Microsoft OLE DB Provider for SQL Server error '80040e57'
Arithmetic overflow error converting expression to data type int

It is connecting to a MSSQL database using ASP.

strsqlCFG1 = "SELECT TOP 5 tblCustomers.*,tblCustomers.CustID AS CustKey FROM tblCusomers WHERE  tblCustomers.Active='Active' ORDER BY RAND(-(1000*CustID)* " & R & ")"

The error goes away when I remove:
ORDER BY RAND(-(1000*CustID)* " & R & ")"

Any ideas?
0
Comment
Question by:JuniorBee
[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
  • 2
3 Comments
 
LVL 96

Accepted Solution

by:
Lee W, MVP earned 500 total points
ID: 16905204
Reduce the 1000 to 100 or 10.  An integer value can be only so large and you're exceeding that.
0
 

Author Comment

by:JuniorBee
ID: 16905268
Thanks !
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 16906419
Integer data types max out at a little over 2 billion (4 billion possible numbers, 2 billion positive, 2 billion negative).  Make sure whatever you multiply by will NEVER reach that point or you may have this problem randomly again in the future.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

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 would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

728 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