MATLAB can't read time column in database (querybuilder and dexplore)
조회 수: 2 (최근 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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147386/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147388/image.bmp)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147390/image.bmp)
댓글 수: 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!