VBNET, mysql and time field error
-
I have an sql query like "select id, text, time from table" filling a datagrid. i have a problem with the datagrid values in the time cell. It says that has null values or 00:00:00 value. I don't know why. If I make the same query directly in mysql, it returns correct values. I test the same query with a little variation "select id, text, HOUR(time) from table".This time, the datagrid shows the correct values (12, 06, etc). Someone knows why is happening this?
-
I have an sql query like "select id, text, time from table" filling a datagrid. i have a problem with the datagrid values in the time cell. It says that has null values or 00:00:00 value. I don't know why. If I make the same query directly in mysql, it returns correct values. I test the same query with a little variation "select id, text, HOUR(time) from table".This time, the datagrid shows the correct values (12, 06, etc). Someone knows why is happening this?
Well, I solved the problem this workaround: "select id, text, DATE_FORMAT(time,'%H:%i:%S') from table" Hope this helps to somebody!