Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Numeric fields in SQL vs VFP
Message
 
 
To
01/04/2010 22:46:59
General information
Forum:
Microsoft SQL Server
Category:
Database design
Environment versions
SQL Server:
SQL Server 2005
Application:
Desktop
Miscellaneous
Thread ID:
01458467
Message ID:
01458482
Views:
80
VFP stores numeric data as a string. It has a few side effects
- A space has to be reserved for minus sign and a dot
- A numeric(10,2) field can store a value up to 10^10 by discarding a decimal part

As I see it, you have 2 choices
- Add a picture clause to all textboxes affected by this
- Change size of the columns on backend

Neither has to be done manually.


>I am converting an application from VFP as data and VFP as UI to SQL/VFP as a database and VFP as a front end.
>I did not notice it right away, but numeric type in SQL server is slightly different then in VFP.
>In SQL server, if I setup type of a field to be numeric(10,2), it means that it will allow 10 digits total, 2 of which will be after decimal point.
>I do not have to provide an additional digit for the "-" sign or for the decimal point. In VFP - 10 characters total, 2 digits after decimal point, but it will include decimal point and a "-" sign if negative number is used as part of the 10 characters.
>
>I also have noticed that if I use SPT or even a stored procedure to bring the data from the server, the numeric field type will change. So my numeric(10,2) field will become numeric(12,2). Which is great, but .... my users now can enter a bigger number then the data structure allowed. When saving the entered data to the server they will receive an error. Most of my numeric fields on the form depend on the control source, to control the size of the data entered into it. There would be too many objects on the screen to enter an input mask individually. Did anyone has this issue? Any suggestions?
>
>Thank you
>Yelena
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform