MySQL - Matlab and stupid time stamp which includes the tenths of a second.
1 view (last 30 days)
Show older comments
Hello, I'm working on a program that takes some data from a database in MySQL.
I want to extract some measurements that have been stored with a really stupid time stamp like this:
Reference
266023 which corresponds to time stamp 2012-09-04 17:27:07.344
........
........
19388000 which corresponds to time stamp 2012-10-04 17:27:07.766
The code I use to extract data is using the Reference number as condition:
curs = exec(conn, ['SELECT * FROM `data` WHERE Reference >= ''266023'' AND Reference <= ''19388000'' ']);
For me it is easier to search using the time stamp.
My problem is the stupid format of the time stamp. It counts also the tenths of a second.
Is there any way to exclude the tenths of a second in the search conditions?? Note:the time stamp is char 1x23. How can I put in condition only the 1x19 (exclude he .xxx)
Could I write something like this??
curs = exec(conn, ['SELECT * FROM `data` WHERE Time >= ''2012-09-04 17:27:07'' AND Time <= ''2012-10-04 17:27:07'' ']);
Thanks
0 Comments
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!