Jump to content


Photo

Multiple timestamps


  • Please log in to reply
1 reply to this topic

#1 Eiolon

Eiolon
  • Members
  • PipPipPip
  • Advanced Member
  • 357 posts

Posted 02 August 2006 - 10:26 PM

Hello,

I am creating a help desk and would like it to stamp the date/time when a request is submitted and also a date/time when the request is completed.  How would I go about having two timestamps?  Here is what I have for my structure:

create table requests (
id int not null primary key auto_increment,
employee varchar(50) not null,
category varchar(50) not null,
priority varchar(10) not null,
description text not null,
status varchar(10) not null default 'Open',
submitted timestamp not null default current_timestamp,
completed timestamp not null default current_timestamp,
technician varchar(50) not null
);

I get this error:

ERROR 1293 (HY000): Incorrect table definition; there can be only one TIMESTAMP
column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause


How do I accomplish two timestamps?  Thanks!

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 02 August 2006 - 11:38 PM

Not sure... I'm sure there's a refman page on these crazy column attributes.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users