If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Mysql CAST

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-20-05, 13:05
pokahantas pokahantas is offline
Registered User
 
Join Date: Oct 2005
Posts: 2
Question Mysql CAST

Hi !

Does anyone know how to cast a string date like '2005-10-12 12 : 15 : 00' in a DATETIME format in an Update query ?
Thank you.
Reply With Quote
  #2 (permalink)  
Old 10-20-05, 13:27
jfulton jfulton is offline
Registered User
 
Join Date: Apr 2005
Location: Baltimore, MD
Posts: 297
Code:
SELECT TIMESTAMP( str_to_date( '2005-10-12 12:15:00', '%Y-%m-%d %H:%i:%s' ) )
Reply With Quote
  #3 (permalink)  
Old 10-20-05, 14:15
pokahantas pokahantas is offline
Registered User
 
Join Date: Oct 2005
Posts: 2
It Works

It works with timestamp. In my case, i use it in an update query and it is working very well.
Thank you.
Reply With Quote
  #4 (permalink)  
Old 10-20-05, 16:38
khibinite khibinite is offline
Registered User
 
Join Date: Oct 2003
Posts: 63
Hi!

May you clarify what do you mean: would u like to update every record in the table?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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