Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SET DECIMAL TO 0 and Views
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement