Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Arithmetic overflow error converting expression to data type int

Posted on 2006-06-14
3
Medium Priority
?
565 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
  • 2
3 Comments
 
LVL 97

Accepted Solution

by:
Lee W, MVP earned 2000 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 97

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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Loops Section Overview
Suggested Courses
Course of the Month21 days, 5 hours left to enroll

810 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