Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > MySQL > Date format problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-08-03, 03:47
poojajt poojajt is offline
Registered User
 
Join Date: Sep 2003
Location: CA
Posts: 38
Date format problem

Hi,
whenever i try to enter a date it acts weird and gives me some stupid value...when i went thru' the MYSQL site the format as per them is YYYY-MM-DD and i tried to enter the row value in the same format but everytime i change the value it gives something else......
this is the statement in the create table statement for defining this field...........
Mail_received_date date

i tried the follwoing statement with different values 'n it gives me a new date inserted everytime...

update mail set mail_received_date=12/3/2003 where mail_id ='1';

date value inserted by me ------- actual date inserted
12/3/2003 --------- 2000-00-20
2003-02-11 -------- 0000-00-00
03/11/2003 --------- 2000-00-01
31/11/2003 --------- 2000-00-14
31/01/2003 ---------- 0000-00-00
31/10/2003 ----------- 2000-00-15
2031/10/2003 ---------- 2000-10-14
02112003 ---------- 0000-00-00
2031/2010/2003 ---------- 2000-00-05

Last edited by poojajt : 12-08-03 at 03:49.
Reply With Quote
  #2 (permalink)  
Old 12-08-03, 05:24
Mincer Mincer is offline
Registered User
 
Join Date: Sep 2003
Location: London
Posts: 56
Your inserts should be:

Code:
UPDATE mail SET mail_received_date = 'YYYY-MM-DD' where mail_id = '1' ;

..and only if the mail_id column is a char/string type. If it's a number, it should be:

Code:
UPDATE mail SET mail_received_date = 'YYYY-MM-DD' where mail_id = 1 ;

(note, no quotes on mail_id)

Regards,

Matt.
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

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