Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Numeric Overflow

Status
Not open for further replies.

stlrain95

Programmer
Sep 21, 2001
224
US
I keep getting an error on a calculation for numeric overflow. I have the field open as large as I can get it.

the calculation takes a number and multiplies by 100. How can I get around this or fix this error?

Thanks,
 
Are you doing this calculation in a REPLACE or in a "temp" variable and then replacing it? What exactly is the type and size of the field you are using? What version and SP (Service Pack) of VFP are you using?

Rick
 
This is referenced in a REPLACE. It is a numeric field with 12 being the largest I can expand it. It is a number * by 100 to get result.

When I do I get a numeric overflow.
 
Hi
Probably, you have defined that field as 'Integer'.. If that is the case, you modify that to 'Numeric' type. Still I wonder what is causing the trouble.. :) ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
I just created and ran the following program. Everything works fine if the two commented out lines are not used. If these two lines are put in, then I get one "Numeric Overflow. Data was lost." message and the data for their resulting values show "bad". Therefore from what I see, as long as you don't have any values greater than 9,999,999,999 before the update, you won't get any errors.

Code:
CREATE CURSOR testOF (field1 N(12,0))
INSERT INTO testOF VALUES (1)
INSERT INTO testOF VALUES (10)
INSERT INTO testOF VALUES (100)
INSERT INTO testOF VALUES (1000)
INSERT INTO testOF VALUES (1000000)
INSERT INTO testOF VALUES (10000000)
INSERT INTO testOF VALUES (100000000)
INSERT INTO testOF VALUES (1000000000)
INSERT INTO testOF VALUES (9999999999)
*INSERT INTO testOF VALUES (10000000000)
*INSERT INTO testOF VALUES (100000000000)
BROWSE
REPLACE ALL field1 WITH field1*100
GO TOP
BROWSE NOWAIT

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top