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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Update a date/time field through VB. net

Update a date/time field through VB. net

Scheduled Pinned Locked Moved Database
databasehelpquestioncsharpannouncement
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.
  • J Offline
    J Offline
    Johnkokk
    wrote on last edited by
    #1

    How do I update a date/time field in a Microsoft Access database using SQL ? I am using VB .net and up to now all my sql statements work fine. I have tried several variations of this statement but none work. They all give me a generic "Error in UPDATE statement" message.If i try any other column of my database, the UPDATE statement works fine.It only has a problem with the TIME field which is declared in the database as DATE/TIME. For instance the following will NOT work.

    UPDATE tablename SET timecolumn='12:34' where id=82

    J 1 Reply Last reply
    0
    • J Johnkokk

      How do I update a date/time field in a Microsoft Access database using SQL ? I am using VB .net and up to now all my sql statements work fine. I have tried several variations of this statement but none work. They all give me a generic "Error in UPDATE statement" message.If i try any other column of my database, the UPDATE statement works fine.It only has a problem with the TIME field which is declared in the database as DATE/TIME. For instance the following will NOT work.

      UPDATE tablename SET timecolumn='12:34' where id=82

      J Offline
      J Offline
      Johnkokk
      wrote on last edited by
      #2

      Never mind.I figured it out. I needed brackets for the time field. So it should be :

      UPDATE tablename SET [time]='12:34' where id=80

      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