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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REAL Data type in CA or RV

Status
Not open for further replies.

Ed Andres

IS-IT--Management
Mar 27, 2001
142
US
I'm trying to manage data in a SQL table using a VFP 9 form and I was planning to use a CursorAdapter to handle the data heavy lifting. I ran into a problem where one of the columns in the SQL table has a data type of REAL and has data that goes out several decimal places. This would be a number you might see in this column 0.00014504. The CA or for that matter a RV both see this as B(2) which is Double with a precision of 2. The problem with this is that on the numbers like above, I get 0.00 which is no good. I have tried to change the precision in the CA but it continues to give the the same result as if the precision does not have any effect. Anyone run into this before and have any thoughts? Am I missing something?

Ed
 
Ok, so after further review, there is a checkbox I missed that says use CursorSchema when filling Cursor which in turm fixes the data length issue but creates a new one. The problem is now it seems to be giving me slightly different data. Here is what I mean, the SQL data might look like this: 14.969 but when I set the CA to B(8) or even N(10,8) on that field, I get 14.96900010 or with 14.2233 I get 14.22329998. Pretty strange, to me anyway. Any thoughts?

Ed
 
Just a typical rounding problem because computers cannot natively understand decimal numbers. You may need to round those numbers to get what you want, BUT it may not totally clear up the problem for some numbers.

mmerlinn


"Political correctness is the BADGE of a COWARD!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top