Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding large numbers
Message
De
13/09/2013 08:12:55
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01582980
Message ID:
01583126
Vues:
50
>>>If I'm running this code, the result is incorrect, because VFP cannot handle that large numbers.
>>>What would be a workaround?
>>>
>>>CREATE CURSOR cuTest (test c(20))
>>>FOR lnNr = 1 TO 7000
>>>	INSERT INTO cutest VALUES ("123456789012345")
>>>endfor
>>>SUM VAL(test) TO lntest
>>>
>>
>>
>>Does this work?
>>
>>
SELECT CAST(VAL(test) AS Currency) AS nBigNumber ;
>>    FROM cuTest ;
>>    INTO CURSOR c_temp
>>
>>SUM nBigNunber TO lnTest
>>
>>* Or, use a direct SUM() in the SQL SELECT.
>
>It gives an error "Currency value out of range".


I hadn't seen the solution post, but try Double.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform