Update a DATETIME field

This is a discussion on Update a DATETIME field within the MySQL Database forums, part of the Database Forums category; Hi... I have entered a value like: INSERT INTO r VALUES(1,CURRENT_TIMESTAMP); What I am curious to know is ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-16-2007
JoeT
 
Posts: n/a
Default Update a DATETIME field

Hi...

I have entered a value like: INSERT INTO r
VALUES(1,CURRENT_TIMESTAMP);

What I am curious to know is if there is a way to just change the TIME
value of the existing record, or must I keep 2-separate fields with
DATE and TIME datatypes?

Thanks,
Joe

Reply With Quote
  #2 (permalink)  
Old 10-16-2007
Captain Paralytic
 
Posts: n/a
Default Re: Update a DATETIME field

On 16 Oct, 16:55, JoeT <trub...@yahoo.com> wrote:
> Hi...
>
> I have entered a value like: INSERT INTO r
> VALUES(1,CURRENT_TIMESTAMP);
>
> What I am curious to know is if there is a way to just change the TIME
> value of the existing record, or must I keep 2-separate fields with
> DATE and TIME datatypes?
>
> Thanks,
> Joe


Something like
UPDATE r SET my_time_field = TIMESTAMPADD(MINUTE,1,my_time_field);

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:38 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0