Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET DECIMAL TO 0 and Views
Message
From
27/03/2001 10:22:24
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SET DECIMAL TO 0 and Views
Miscellaneous
Thread ID:
00488974
Message ID:
00488974
Views:
37
Using VFP6 SP4.

I defined a local view as follows, but get 2 different results depending on where I open the view.

***View definition. Only 1 field. Convert the character field to numeric.
create sql view myview as ;
select distinct VAL(mytable.mycfield) AS Code where

***Results 1
* From the command window.
* This examples opens the view. The view has 1 mumeric field with no
* decimals. This is the desired results.
***
SET DECIMAL TO 0
USE myview
DISPLAY STRUCTURE &&1 numeric field 0 decimal. Good!
***End results 1

***Results 2
* From a form with a private datasession. The view is opened in the data
* environment. In the LOAD() I issue a SET DECIMAL TO 0. In the INIT() I
* =REQUERY("myview").
*
* The problem is that this same view is created with 1 numeric field with
* a decimal of 2. NOT what we want.
*
*
***

Why does this view's field have no decimal in the command window, but 2 decimals in the form?

I use DISPLAY STRUCTURE to see if the view's field has a decimal or not.

The SET DECIMAL TO 0 hides the decimal but why is the view's structure different in the command window vs the form?

Thanks,

Jerryt
Next
Reply
Map
View

Click here to load this message in the networking platform