SQL Query on DECIMAL returns characters
5 views (last 30 days)
Show older comments
Hi,
I have an SQL-Query (SELECT * FROM MyTable) which is executed on a Microsoft SQL Server. One column is formattet as DECIMAL(18,10) not nullable in the SQL table, but the reuslt in Matlab is characters, and aslo the decimal point is returned as a comma.
So instead of 11229.3 I get '11229,3'
An other column which is INT works correctly and I have a number in Matlab.
(Maybe this has something to do with the interchanged comma and decimal point in Germany? For Example in Excel we have 11.229,3 but Matlab and SQL both usually have the number format like this: 11229.3)
Of course I can somehow in Matlab convert the string to a number, but I am looking for a clean solution.
Thanks for the support.
1 Comment
Dave Chandler
on 7 Dec 2022
A little more information might be helpful:
Are you using a JDBC or ODBC driver?
Which version of MATLAB are you using?
Can you share sample code on how you are fetching the data?
Answers (0)
See Also
Categories
Find more on Database Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!