Results 1 to 2 of 2

Thread: MySQL datetime

  1. #1
    Join Date
    Dec 2002
    Location
    Nepal
    Posts
    32

    Unanswered: MySQL datetime

    Hi friends,

    I would like to update the Day in datetime filed of mysql how i can do this.

    for the example
    2009-07-29 20:12:45' is the value in DB now i need to change only 29 to 28 and the final will be 2009-07-28 20:12:45

    Regards,

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    UPDATE daTable
       SET daDate = daDate - INTERVAL 1 DAY
     WHERE somekey = 'somevalue'
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •