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 > Date format problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-08-03, 02: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 02:49.
Reply With Quote
  #2 (permalink)  
Old 12-08-03, 04: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

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