Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SET DECIMAL TO 0 and Views
Message
De
27/03/2001 10:22:24
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SET DECIMAL TO 0 and Views
Divers
Thread ID:
00488974
Message ID:
00488974
Vues:
36
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform