Hi,

a friend of mine is using VFP8 with data in MS SQL. 
Here is the code:

Local oCN
oCN=Createobject("ADODB.Connection")
oCN.Open("Provider=SQLOLEDB.1;"+;
  "Data Source=(Local);"+;
  "Initial Catalog=master;"+;
  "User ID=sa;"+;
  "Password=<ovde lozinka za sa>;")
With oCN.Execute("select convert(decimal(10,3),8.04) as Kolicina")
  If .State=1
    Messagebox(.Fields("Kolicina").Value) && Rezultat 8,04
    Messagebox(.Fields("Kolicina").Value*100) && Rezultat 804
    Messagebox(Int(.Fields("Kolicina").Value*100)) && Rezultat 803!!!!
  Endif
Endwith

As you can see the problem arises when using INT() function on a field with 
value of 8.04

He later tried testing values from 0.01 to 9.99 and the first wrong value came 
at 4.02 

Kolicina=4.02, Int(Kolicina*100)= 402, Int(Kolicina*100000)= 401999

Does anyone have idea what is the problem?

Zed



--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to