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 > CHAR(19) date field formats (was "SQL Statement help")

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-17-05, 01:46
awdang_99 awdang_99 is offline
Registered User
 
Join Date: Feb 2005
Posts: 1
CHAR(19) date field formats (was "SQL Statement help")

Hello,

I have a table with the following fields:

ID [char(50]-- unique
Created_DT [char(19)]
Updated_DT [char(19)]

Currently, the Created_DT contains date and time data as follows: '0000-00-00 00:00:00'. The Updated_DT contains dates in this format: '2004-02-16 12:45:03'.

What I want to do is take the date in the Updated_DT field and copy it into this format to the Created_DT field: '02/16/2004 12:00:00'.

Can someone tell help me with this?

Thanks
Reply With Quote
  #2 (permalink)  
Old 02-18-05, 07:54
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
1. have you looked at the SUBSTRING and CONCAT functions?

2. why aren't they DATE datatypes instead of CHAR?

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
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