>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?
Can you use CAST in your select statement to properly assign the datatype?
E.g. CAST(0 as N(10,2)) as Amount ?
This would work in both versions.
If it's not broken, fix it until it is.
My Blog