Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot get the decimals portion of a numeric field
Message
 
À
04/04/2008 12:27:14
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01308259
Message ID:
01308266
Vues:
9
You need to cast your field:
SELECT Client.Name,cast(0 as money) AS Amount FROM Client
>I have a SQL command that is included some calculcated fields such as:
>
>
>SELECT Client.Name,0 AS Amount FROM Client
>
>
>Then, later on in the code, I can assign a value in the Amount field by the use of the DataRow. This is working good as long as I am using VFPOleDb. As soon as I switch to the SQLClient provider to use a SQL Server backend, I have found out that even if I put 23.23 in the Amount field, I will end up with 23.
>
>I need to avoid changing the SQL. Is there a way down below the code that I can adjust the datatype for that column so it will know that I wish to deal with decimals?
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform