Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a FoxPro equivalent of T-SQL CONVERT() ?
Message
De
08/10/2002 10:58:26
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00708750
Message ID:
00708764
Vues:
8
>does the T-SQL statement:
> select convert( float, int1 / int2 ) as myFloat
> into tempTable From ......
>
>have an equivalent in FoxPro ?
>I tried this:
> select int1/int2 as myFloat ;
> from ... ;
> into table tempTable
>
>the problem with this is that tempTable is created using the structure from the very first record of the resulting query. If the very FIRST records has int1 = 0, then the resulting data type of myFloat in tempTable is N(1,0) !!!!
>
>For all subsequent data, the myFloat value truncates the results to fit N(1,0) data type !
>
>help !
>
>my queries need to be dynamic (based on user-selections, complicated with the fact that each client has different data, but I would like to keep a common code base), so I cannot anticipate the structure of the tempTable before the query is run.

Multiply the result with 1.0000 where 0's are as many decimals as you want.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform