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

Different SQL View when program running vs. Stand alone SQL View

Status
Not open for further replies.

CTMHSH

Programmer
Jun 13, 2002
6
US
Hello

I am creating a view to download some data from our SQL Server. When I create the SQL View in the VFP program view is rounding my numbers to 2 decimal points. (Example 0.1234 = 0.1200) If I browse the view with the progam off see the data the way it should be. The SQL table fields are money type coming in. Does anyone know of a fix so that the data in coming into the view is the same as when the program recieves the view data? Can fields in an SQL view be given attributes like N(10,4) or C(25)?

Thanks for any help

Craig
 
HI
If the field is a currency type field, the decimals are set to 4.
SET FIXED ON
SET DECIMALS TO 2

This should help you out :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
look in thehelp on
SET FIXED ON | OFF

SET DECIMALS TO

the default is 2 Attitude is Everything
 
Hi

Thank you but I tired that already, it still has the wrong data in the fields. I have now checked another view and it is doing the same thing. Is there something else I can try (some other VFP command) or might it be an SQL problem when the connection is made and loading the data?

Thanks

Craig
 
Craig,
Try changing the field From:
Code:
  myCurrency
TO
Code:
  (00000.0000+myCurrency) as myCurrency
This should force the 4 decimals.

Rick
 
Thank you all for your help. These suggestions put me on the right path to finding the solution I needed.

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top