SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2005
    Location
    doberman
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ADDTIME() function help

    Hey SP,

    I am trying to use the ADDTIME() function to add minutes to a stored time value. The brainiac who designed the table has the time fields set as varchar (And I can't change it) so I need to convert the value to a date and then ADDTIME, 10,20,30 mins or whatever to the time, then convert it back to a string and update the tabl. What I would like to do is some thing like this:

    Code:
    SELECT convert( alarm_time, time )  AS storedTime
    FROM timetable
    ADDTIME( storedTime, 00 :05 :00 ) AS newTime
    UPDATE timetable SET alarm_time = newTime WHERE task_id =729
    I know this is probably way off but how would I accomplish my goal??

    Thanks,
    Got logical business solutions? Get SuM!
    Greg Starr (SuM)
    LogicStation.net
    Florida Based Contract Web Developer

  2. #2
    SitePoint Wizard swdev's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    1,053
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This was posted here where I gave an answer


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
  •