Michael Stassen wrote:

Just a quick reply for now . . .

Ummm, if you delete the numbers to the *left* of the decimal point,
"2005-01-15 10:15:42.41837" will turn into ".41837", which is still not a valid datetime. You need to delete the numbers to the *right* of the decimal point (which I expect you meant), *and* you need to delete the decimal point. Then you'll have a valid datetime (e.g. "2005-01-15 10:15:42").

I meant to say to the *right*, including the decimal point. I still get the date column set to 0000-00-00 when I upload the edited file.

Here's an example of one of the tables where the date was retained successfully, with the string to the right of the decimal point being trimmed:

1       Cobweb  2005-01-13 15:21:50.654149
2       Lace Weight     2005-01-13 15:21:50.654149
3       Sock    2005-01-13 15:21:50.654149


And the CREATE query for this table:

CREATE TABLE StandardWeightType (
       standard_wt_type_id int UNSIGNED NOT NULL AUTO_INCREMENT,
       standard_wt_desc     varchar(50) NULL,
       standard_wt_lud      datetime NULL,
       PRIMARY KEY (standard_wt_type_id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8;

select * from standardweighttype:

+---------------------+------------------+---------------------+
| standard_wt_type_id | standard_wt_desc | standard_wt_lud     |
+---------------------+------------------+---------------------+
|                   1 | Cobweb           | 2005-01-13 15:21:50 |
|                   2 | Lace Weight      | 2005-01-13 15:21:50 |
|                   3 | Sock             | 2005-01-13 15:21:50 |
|                   4 | Fingering        | 2005-01-13 15:21:50 |
|                   5 | Baby             | 2005-01-13 15:21:50 |
|                   6 | Sport            | 2005-01-13 15:21:50 |
|                   7 | Double Knitting  | 2005-01-13 15:21:50 |
|                   8 | Worsted          | 2005-01-13 15:21:50 |
|                   9 | Aran             | 2005-01-13 15:21:50 |
+---------------------+------------------+---------------------+


I'm not sure why it worked for this table and not the Yarn table.

I'll try out the proposed solutions later today. I do need to be able to use the date column since I will be inserting new records into the database via a web application that I will be developing; I am moving the data over from a PostgreSQL database which I'd developed earlier since I've decided to concentrate on MySQL for the time being.

--
Lola - mailto:[EMAIL PROTECTED]
http://www.lolajl.net | Blog at http://www.lolajl.net/blog/
Freedom is not free.
I'm in Bowie, MD, USA, halfway between DC and Annapolis.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to