SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru Dashman's Avatar
    Join Date
    Jan 2006
    Location
    Manchester, UK
    Posts
    627
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    DATETIME field, update only day

    Hi all,

    I have a datetime field in my DB that I am needing to update every morning to the current day. This is purely for some testing I am working on.

    I am needing to keep all the times the same, and only update the day portion of the datetime field to the current day.

    Is there a simple query I can run to do this?

    D

  2. #2
    SitePoint Evangelist
    Join Date
    Mar 2006
    Location
    Sweden
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something like:
    UPDATE table SET datecol = DATE_ADD( datecol, INTERVAL 1 DAY );


Bookmarks

Posting Permissions

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