MATLAB can't read time column in database (querybuilder and dexplore)
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I'm trying to import some data from a database using dexplore. When I navigate through the GUI, the time field is blank, almost like MATLAB can't read the data. I know there is data there because I can see all the timestamps in SQL Server Management Studio. Please see the attached screen shots.
How can I fix this?
First image is the time column's properties in SQL Server Management Studio Second image is the view in Management Studio. Third image is the view in dexplorer in matlab.
0 个评论
回答(1 个)
J
2015-7-26
1 个评论
Justin Koch
2020-9-11
I'm assuming you're not still trying to figure this out 5 years later, but for anyone who stumbles across this thread like I did: the trick is to convert your time field to a character one prior to attempting import into MATLAB.
e.g. in SQL convert the column storing times to NVARCHAR
CONVERT(NVARCHAR, TimeColumn) as 'Time'
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Database Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!