9 messages in com.mysql.lists.win32RE: Simple Value Insertion
FromSent OnAttachments
S.D.Price15 Mar 2004 08:56 
Jim Bartram15 Mar 2004 09:09 
Petr Vileta15 Mar 2004 13:45 
S.D.Price16 Mar 2004 06:30 
Petr Vileta16 Mar 2004 09:13 
Matt Fagan16 Mar 2004 17:39 
S.D.Price17 Mar 2004 01:33 
S.D.Price17 Mar 2004 02:12 
John D. Herron17 Mar 2004 08:01 
Subject:RE: Simple Value Insertion
From:John D. Herron (para@bluewin.ch)
Date:03/17/2004 08:01:12 AM
List:com.mysql.lists.win32

Hello Steve. I believe mySQL allows dates only in the YYYY-MM-DD format. Accordingly, '20041601' or '200417002' don't look to me like legal mySQL dates (because they feature an improbable 16th and 17th month). Might formatting the dates as '20040116' and '20040217' solve the problem ? jdh

At 09:33 17-03-04 +0000, you wrote:

Hi I am on 4.0.18-nt. I tried:

UPDATE tblsitefeature SET updated = 20041601 WHERE id = 1;

UPDATE tblsitefeature SET updated = 20041702 WHERE id = 2;

And still got '0000-00-00'

I tried:

INSERT INTO tblsitefeature (updated) VALUES (20041601) WHERE id = 1;

INSERT INTO tblsitefeature (updated) VALUES (20041702) WHERE id = 2;

And got a syntax error.

-----Original Message----- From: Matt Fagan [mailto:m_fa@yahoo.com] Sent: 17 March 2004 01:40 To: win@lists.mysql.com Subject: Re: Simple Value Insertion

Steve, what is your version of mysql and default character set? I had a similar problem with dates on mysql 4.1.1a with UTF8 encoding. Apparantly this is a bug in 4.1.1, but it has been fixed for 4.1.2 (whenever it is released). You can get around it by inserting/updating using:

INSERT INTO tblsitefeature (updated_on) VALUES (20041601);

I.e, change the date to a number, not a string.

Hi all I think I made a mistake somewhere because when I used the code

INSERT INTO tblsitefeature (updated_on) VALUES ('2004-16->01) WHERE id = 1;

. . .

But when I checked the db for both records the updated field shows

0000-00-00

Can anyone tell what I did wrong and how I can correct the problem.

Many thanks Steven

Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com