Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to typecase a numeric type
Message
De
16/07/1997 22:57:32
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
16/07/1997 22:25:58
Shihchau Tai
Apic Systems Pte Ltd
Singapore, Singapour
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00040343
Message ID:
00040349
Vues:
29
>I am using FPW26. I am trying to UNION two select statement. The SELECT statement looks like the following:
>
>SELECT a.doc_no, doc_date, SUM(apply+discount+miscellaneous) AS problem;
> from a, b ;
> where a,doc=b.doc ;
>UNION ;
>SELECT a.doc, doc_date, doc_amt ;
> from a ;
> where .......
>
>
>Anybody can tell me how I can force the SUM() type to be the Numeric size I want. apply is N(9,2). discount is N(7,2), miscellaneous is N(7,2), problem ended up as N(16,2) and my doc_amt is N(9,2). How to force problem to be N(9,2)?
>
>
>Tai SC

You are so right this silly behaviour. A silly but working suggestion is here :
SELECT a.doc_no, doc_date, SUM(apply+discount+miscellaneous) * 1000000.00/1000000.00 AS problem;
from a, b ;
where a,doc=b.doc ;
UNION ;
SELECT a.doc, doc_date, doc_amt* 1000000.00/1000000.00 ;
from a ;
where .......

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform