Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. VBNET, mysql and time field error

VBNET, mysql and time field error

Scheduled Pinned Locked Moved Visual Basic
databasehelpmysqlquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ecentinela
    wrote on last edited by
    #1

    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?

    E 1 Reply Last reply
    0
    • E ecentinela

      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?

      E Offline
      E Offline
      ecentinela
      wrote on last edited by
      #2

      Well, I solved the problem this workaround: "select id, text, DATE_FORMAT(time,'%H:%i:%S') from table" Hope this helps to somebody!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups