Re: Creating Table with a Default Datetime field

2001-06-28 Thread Paul DuBois
At 11:57 AM +0200 6/28/01, Kaneda K wrote: >At 10:38 27/06/2001 -0700, you wrote: >>Sorry, for quoting the manual but this might be just another example where >>it could have the answer right away: >>Hannes >> >>http://www.mysql.com/doc/D/A/DATETIME.html > >On my own mysql version : > Date TIMEST

Re: Creating Table with a Default Datetime field

2001-06-28 Thread Gerald Clark
No. Since the string "now()" is not a valid date it is equivalent to 0, so MySQL inserts the current date and time. Kaneda K wrote: > At 10:38 27/06/2001 -0700, you wrote: > >> Sorry, for quoting the manual but this might be just another example >> where >> it could have the answer right away

Re: Creating Table with a Default Datetime field

2001-06-28 Thread Kaneda K
At 10:38 27/06/2001 -0700, you wrote: >Sorry, for quoting the manual but this might be just another example where >it could have the answer right away: >Hannes > >http://www.mysql.com/doc/D/A/DATETIME.html On my own mysql version : Date TIMESTAMP default "now()", Works correctly, the date is YY

Re: Creating Table with a Default Datetime field

2001-06-27 Thread Rich Duzenbury
Only the first timestamp is updated by MYSQL. Create two timestamp fields. MySQL will maintain the first one. Set timestamp2 to null when the record is created. Regards, Rich At 10:54 AM 6/27/01 -0500, Pete Harlan wrote: >TIMESTAMP is not the solution to his problem; he wants the date to >

RE: Creating Table with a Default Datetime field

2001-06-27 Thread Sherzod Ruzmetov
ilto:[EMAIL PROTECTED]] > Sent: Wednesday, June 27, 2001 2:10 PM > To: Ravi Raman > Cc: Pete Harlan; Richard Bates; [EMAIL PROTECTED] > Subject: RE: Creating Table with a Default Datetime field > > > > Wait, I didn't get the following: > > > &g

RE: Creating Table with a Default Datetime field

2001-06-27 Thread Ravi Raman
erzod Ruzmetov [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 27, 2001 2:10 PM To: Ravi Raman Cc: Pete Harlan; Richard Bates; [EMAIL PROTECTED] Subject: RE: Creating Table with a Default Datetime field Wait, I didn't get the following: > an alternate solution is to have a table like th

RE: Creating Table with a Default Datetime field

2001-06-27 Thread Sherzod Ruzmetov
: Pete Harlan > Cc: Ravi Raman; Richard Bates; [EMAIL PROTECTED] > Subject: Re: Creating Table with a Default Datetime field > > > > > I, c. Then you just have to INSERT INTO it NOW() manually, that works > > > On Wed, 27 Jun 2001, Pete Harlan wrote: > >

RE: Creating Table with a Default Datetime field

2001-06-27 Thread Ravi Raman
- From: Sherzod Ruzmetov [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 27, 2001 1:40 PM To: Pete Harlan Cc: Ravi Raman; Richard Bates; [EMAIL PROTECTED] Subject: Re: Creating Table with a Default Datetime field I, c. Then you just have to INSERT INTO it NOW() manually, that works On Wed, 27

Re: Creating Table with a Default Datetime field

2001-06-27 Thread Gerald Clark
Well, almost true. On insert, all timestamp fields are updated. On update, only the first timestamp field is updated. So, If you have two timestamp fields, you can get the result you want. Pete Harlan wrote: > TIMESTAMP is not the solution to his problem; he wants the date to > default to now()

Re: Creating Table with a Default Datetime field

2001-06-27 Thread Sherzod Ruzmetov
I, c. Then you just have to INSERT INTO it NOW() manually, that works On Wed, 27 Jun 2001, Pete Harlan wrote: > TIMESTAMP is not the solution to his problem; he wants the date to > default to now() when the record is created, not updated. > > There's currently no way to do this in MySQL; def

Re: Creating Table with a Default Datetime field

2001-06-27 Thread Hannes Niedner
Sorry, for quoting the manual but this might be just another example where it could have the answer right away: Hannes http://www.mysql.com/doc/D/A/DATETIME.html > The TIMESTAMP column type provides a type that you can use to automatically > mark INSERT or UPDATE operations with the current date

Re: Creating Table with a Default Datetime field

2001-06-27 Thread Pete Harlan
TIMESTAMP is not the solution to his problem; he wants the date to default to now() when the record is created, not updated. There's currently no way to do this in MySQL; default values must be constants. --Pete > hi. > > check out the TIMESTAMP column type...maybe TIMESTAMP(14) as the colum

RE: Creating Table with a Default Datetime field

2001-06-26 Thread Ravi Raman
hi. check out the TIMESTAMP column type...maybe TIMESTAMP(14) as the column type? you can then format the date accordingly with...uh...DATE_FORMAT() in your select statements... hth. -ravi -Original Message- From: Richard Bates [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 26, 2001 3: