Default Datetime?

2003-06-09 Thread Trevor Sather
Hello I have a table for messages, and when a new message is inserted I want the current date and time to be inserted into the MessageDated and MessageTimed fields. I'm using MySQL 3.23.56 (?), with Chilisoft ASP, and using the MySQL Control Center interface. The problem is that no matter what

Re: Default Datetime?

2003-06-09 Thread Gabriel Guzman
On Mon, 2003-06-09 at 16:23, Trevor Sather wrote: How can I get the default value to be now()? The only way I've succeeded is by setting the type of field to VARCHAR, but that's not ideal. Trevor, take a look at the TIMESTAMP type: http://www.mysql.com/doc/en/DATETIME.html or, if you would

Re: Default Datetime?

2003-06-09 Thread Becoming Digital
Digital www.becomingdigital.com - Original Message - From: Trevor Sather [EMAIL PROTECTED] To: [EMAIL PROTECTED] Mysql. Com [EMAIL PROTECTED] Sent: Monday, 09 June, 2003 19:23 Subject: Default Datetime? Hello I have a table for messages, and when a new message is inserted I want the current

Re: Default Datetime?

2003-06-09 Thread Paul DuBois
At 0:23 +0100 6/10/03, Trevor Sather wrote: Hello I have a table for messages, and when a new message is inserted I want the current date and time to be inserted into the MessageDated and MessageTimed fields. I'm using MySQL 3.23.56 (?), with Chilisoft ASP, and using the MySQL Control Center

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

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 TIMESTAMP default

Re: Creating Table with a Default Datetime field

2001-06-27 Thread Pete Harlan
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:00 PM To: [EMAIL PROTECTED] Subject: Creating Table with a Default

Re: Creating Table with a Default Datetime field

2001-06-27 Thread Hannes Niedner
- From: Richard Bates [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 26, 2001 3:00 PM To: [EMAIL PROTECTED] Subject: Creating Table with a Default Datetime field How do I get a default date time in the create table clause... I have tried Create table( CreationDateDATETIME

Re: Creating Table with a Default Datetime field

2001-06-27 Thread Sherzod Ruzmetov
: Richard Bates [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 26, 2001 3:00 PM To: [EMAIL PROTECTED] Subject: Creating Table with a Default Datetime field How do I get a default date time in the create table clause... I have tried Create table( CreationDateDATETIME

Re: Creating Table with a Default Datetime field

2001-06-27 Thread Gerald Clark
() in your select statements... hth. -ravi -Original Message- From: Richard Bates [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 26, 2001 3:00 PM To: [EMAIL PROTECTED] Subject: Creating Table with a Default Datetime field How do I get a default date time in the create table

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 Sherzod Ruzmetov
] 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: TIMESTAMP is not the solution to his problem; he wants the date to default to now() when the record is created

RE: Creating Table with a Default Datetime field

2001-06-27 Thread Ravi Raman
: 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 this: Create table( UpdatedDatetimestamp(14

RE: Creating Table with a Default Datetime field

2001-06-27 Thread Sherzod Ruzmetov
] 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 this: Create table( UpdatedDatetimestamp(14), CreationDatetimestamp(14), Infovarchar(100

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

Creating Table with a Default Datetime field

2001-06-26 Thread Richard Bates
How do I get a default date time in the create table clause... I have tried Create table( CreationDateDATETIMEDEFAULT NOW(), Infovarchar(100) ); Create table( CreationDateDATETIMEDEFAULT NOW(), Infovarchar(100) ); Create table(

Default Datetime?

2001-06-26 Thread Richard Bates
How do I get a default date time in the create table clause... I have tried Create table( CreationDateDATETIMEDEFAULT NOW(), Infovarchar(100) ); Create table( CreationDateDATETIMEDEFAULT NOW(), Infovarchar(100) ); Create table(

RE: Creating Table with a Default Datetime field

2001-06-26 Thread Ravi Raman
:00 PM To: [EMAIL PROTECTED] Subject: Creating Table with a Default Datetime field How do I get a default date time in the create table clause... I have tried Create table( CreationDateDATETIMEDEFAULT NOW(), Infovarchar(100) ); Create table( CreationDate

Re: Default Datetime?

2001-06-26 Thread Paul DuBois
At 2:43 PM -0400 6/26/01, Richard Bates wrote: How do I get a default date time in the create table clause... The MySQL Reference Manual states that DEFAULT values must be constants. Insert NOW() into the field when you create new records. I have tried Create table( CreationDate

Re: Default Datetime?

2001-06-26 Thread Sherzod Ruzmetov
But how about TIMESTAMP? For example: CREATE TABLE time_test (creation_date TIMESTAMP, info VARCHAR(100)); This should work fine too,doesn't it? -sherzodR On Tue, 26 Jun 2001, Paul DuBois wrote: At 2:43 PM -0400 6/26/01, Richard Bates wrote: How do I get a default date time in the